Skip to content

Commit

Permalink
Adds VinylGetGMVoice()
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Oct 3, 2024
1 parent e001917 commit 72e44f3
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 2 deletions.
15 changes: 15 additions & 0 deletions scripts/VinylGetGMVoice/VinylGetGMVoice.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Feather disable all

/// Returns the native GameMaker voice index that is currently being played by the target Vinyl
/// voice. If a blend voice is targeted then this function will return an array of GameMaker voice
/// indexes; otherwise, this function will return a GameMaker voice index. If the voice is invalid
/// then this function will return `undefined`.
///
/// @param voice

function VinylGetGMVoice(_voice)
{
if (_voice == undefined) return undefined;

return __VinylEnsureSoundVoice(_voice).__GetGameMakerVoice();
}
13 changes: 13 additions & 0 deletions scripts/VinylGetGMVoice/VinylGetGMVoice.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions scripts/__VinylClassVoiceBlend/__VinylClassVoiceBlend.gml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ function __VinylClassVoiceBlend(_emitter, _pattern, _loopLocal, _gainLocal, _pit
return _result;
}

static __GetGameMakerVoice = function()
{
return __voiceArray;
}

static __UpdateVoiceGains = function()
{
var _voiceArray = __voiceArray;
Expand Down
5 changes: 5 additions & 0 deletions scripts/__VinylClassVoiceHLT/__VinylClassVoiceHLT.gml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ function __VinylClassVoiceHLT(_emitter, _pattern, _gainLocal, _pitchLocal, _duck
return audio_sound_get_asset(__voiceCurrent);
}

static __GetGameMakerVoice = function()
{
return __voiceCurrent;
}

static __IsPlaying = function()
{
return (__voiceCurrent >= 0);
Expand Down
5 changes: 5 additions & 0 deletions scripts/__VinylClassVoiceQueue/__VinylClassVoiceQueue.gml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ function __VinylClassVoiceQueue(_templateName, _behaviour, _loopQueue, _gainLoca
return __soundCurrent;
}

static __GetGameMakerVoice = function()
{
return __voiceCurrent;
}

static __PlaySound = function(_sound, _loop, _gain, _pitch)
{
if (__emitter == undefined)
Expand Down
5 changes: 5 additions & 0 deletions scripts/__VinylClassVoiceShuffle/__VinylClassVoiceShuffle.gml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ function __VinylClassVoiceShuffle(_sound, _voice, _loopLocal, _gainPattern, _gai
return audio_sound_get_asset(__voiceReference);
}

static __GetGameMakerVoice = function()
{
return __voiceReference;
}

static __IsPlaying = function()
{
return audio_is_playing(__voiceReference);
Expand Down
5 changes: 5 additions & 0 deletions scripts/__VinylClassVoiceSound/__VinylClassVoiceSound.gml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ function __VinylClassVoiceSound(_voice, _loopLocal, _gainSound, _gainLocal, _gai
return audio_sound_get_asset(__voiceReference);
}

static __GetGameMakerVoice = function()
{
return __voiceReference;
}

static __IsPlaying = function()
{
return audio_is_playing(__voiceReference);
Expand Down
5 changes: 3 additions & 2 deletions vinyl.resource_order
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
{"name":"VinylGetBlendAnimCurve","order":4,"path":"scripts/VinylGetBlendAnimCurve/VinylGetBlendAnimCurve.yy",},
{"name":"VinylGetBlendFactor","order":2,"path":"scripts/VinylGetBlendFactor/VinylGetBlendFactor.yy",},
{"name":"VinylGetGlobalMetadata","order":1,"path":"scripts/VinylGetGlobalMetadata/VinylGetGlobalMetadata.yy",},
{"name":"VinylGetLength","order":1,"path":"scripts/VinylGetLength/VinylGetLength.yy",},
{"name":"VinylGetGMVoice","order":1,"path":"scripts/VinylGetGMVoice/VinylGetGMVoice.yy",},
{"name":"VinylGetLength","order":2,"path":"scripts/VinylGetLength/VinylGetLength.yy",},
{"name":"VinylGetLoop","order":8,"path":"scripts/VinylGetLoop/VinylGetLoop.yy",},
{"name":"VinylGetPitch","order":1,"path":"scripts/VinylGetPitch/VinylGetPitch.yy",},
{"name":"VinylIsPaused","order":12,"path":"scripts/VinylIsPaused/VinylIsPaused.yy",},
Expand All @@ -95,7 +96,7 @@
{"name":"VinylMixSetPitch","order":4,"path":"scripts/VinylMixSetPitch/VinylMixSetPitch.yy",},
{"name":"VinylMixVoicesFadeOut","order":2,"path":"scripts/VinylMixVoicesFadeOut/VinylMixVoicesFadeOut.yy",},
{"name":"VinylMixVoicesSetPause","order":1,"path":"scripts/VinylMixVoicesSetPause/VinylMixVoicesSetPause.yy",},
{"name":"VinylPatternExists","order":2,"path":"scripts/VinylPatternExists/VinylPatternExists.yy",},
{"name":"VinylPatternExists","order":3,"path":"scripts/VinylPatternExists/VinylPatternExists.yy",},
{"name":"VinylPlayFadeIn","order":2,"path":"scripts/VinylPlayFadeIn/VinylPlayFadeIn.yy",},
{"name":"VinylPlayOn","order":1,"path":"scripts/VinylPlayOn/VinylPlayOn.yy",},
{"name":"VinylQueueClear","order":11,"path":"scripts/VinylQueueClear/VinylQueueClear.yy",},
Expand Down
1 change: 1 addition & 0 deletions vinyl.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 72e44f3

Please sign in to comment.