-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
161 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Feather disable all | ||
|
||
/// Plays a sound or pattern. Sound playback works the same as native GameMaker functions. If you | ||
/// are playing a pattern, the exact playback behaviour will change depending on the type of | ||
/// pattern: | ||
/// | ||
/// - Shuffle chooses a random sound from an array of sounds | ||
/// - Blend plays multiple sounds whose balance can be adjusted by setting the blend factor | ||
/// - Head-Loop-Tail plays a head, then a loop (until the end loop function is called), then a tail | ||
/// | ||
/// This function returns a voice index which can be used with other Vinyl functions to adjust | ||
/// playback and trigger pattern behaviours where relevant. | ||
/// | ||
/// @param emitter | ||
/// @param sound/pattern | ||
/// @param [loop] | ||
/// @param [gain=1] | ||
/// @param [pitch=1] | ||
/// @param [duckerName] | ||
/// @param [duckPriority=0] | ||
|
||
function VinylPlayOn(_emitter, _pattern, _loop = undefined, _gain = 1, _pitch = 1, _duckerName = undefined, _duckPrio = undefined) | ||
{ | ||
static _soundDict = __VinylSystem().__soundDict; | ||
static _patternDict = __VinylSystem().__patternDict; | ||
|
||
if (is_handle(_pattern)) | ||
{ | ||
return struct_get_from_hash(_soundDict, int64(_pattern)).__Play(_emitter, _loop, _gain, _pitch, _duckerName, _duckPrio); | ||
} | ||
else if (is_string(_pattern)) | ||
{ | ||
var _patternStruct = _patternDict[$ _pattern]; | ||
if (_patternStruct != undefined) | ||
{ | ||
return _patternStruct.__Play(_emitter, _loop, _gain, _pitch, _duckerName, _duckPrio); | ||
} | ||
else | ||
{ | ||
__VinylError("Pattern \"", _pattern, "\" not found"); | ||
} | ||
} | ||
else | ||
{ | ||
__VinylError("Datatype not supported (", typeof(_pattern), ")"); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.