1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-05-12 08:00:12 +00:00

Added soundStopAll method to support stopping all sounds when the program is stopped (#91)

This commit is contained in:
boxgaming 2024-01-13 07:19:04 -06:00
parent 4567516347
commit 38ec714954

View file

@ -57,7 +57,9 @@ var GX = new function() {
}
function _reset() {
// TODO: stop any sounds that are currently playing
// stop any sounds that are currently playing
_soundStopAll();
_framerate = 60;
_bg = [];
_images = [];
@ -724,6 +726,14 @@ var GX = new function() {
_sounds[sid-1].currentTime = 0;
}
function _soundStopAll () {
for (var i=0; i < _sounds.length; i++) {
if (_sounds[i]) {
_soundStop(i+1);
}
}
}
function _soundMuted (muted) {
if (muted != undefined) {
_sound_muted = muted;
@ -2522,6 +2532,7 @@ var GX = new function() {
this.soundRepeat = _soundRepeat;
this.soundPause = _soundPause;
this.soundStop = _soundStop;
this.soundStopAll = _soundStopAll;
this.soundVolume = _soundVolume;
this.soundMuted = _soundMuted;