Skip to content

Commit 88d2660

Browse files
Updated and simplified logic for performing locked actions
1 parent aacd7a9 commit 88d2660

1 file changed

Lines changed: 6 additions & 20 deletions

File tree

src/sound/html5/HTML5AudioSoundManager.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,12 @@ var HTML5AudioSoundManager = new Class({
106106
});
107107
};
108108
this.once('unlocked', function () {
109-
var allSoundsTouchLockedActionQueue = [];
110-
_this.forEachActiveSound(function (sound) {
111-
sound.touchLockedActionQueue.forEach(function (touchLockedAction) {
112-
allSoundsTouchLockedActionQueue.push(touchLockedAction);
113-
});
114-
sound.touchLockedActionQueue.length = 0;
115-
sound.touchLockedActionQueue = null;
116-
// TODO set correct duration value
117-
});
118-
allSoundsTouchLockedActionQueue.sort(function (tla1, tla2) {
119-
return tla1.time - tla2.time;
120-
});
121-
allSoundsTouchLockedActionQueue.forEach(function (touchLockedAction) {
122-
switch (touchLockedAction.type) {
123-
case 'method':
124-
touchLockedAction.sound[touchLockedAction.name].apply(touchLockedAction.sound, touchLockedAction.value || []);
125-
break;
126-
case 'property':
127-
touchLockedAction.sound[touchLockedAction.name] = touchLockedAction.value;
128-
break;
109+
_this.lockedActionsQueue.forEach(function (lockedAction) {
110+
if (lockedAction.sound[lockedAction.name].apply) {
111+
lockedAction.sound[lockedAction.name].apply(lockedAction.sound, lockedAction.value || []);
112+
}
113+
else {
114+
lockedAction.sound[lockedAction.name] = lockedAction.value;
129115
}
130116
});
131117
});

0 commit comments

Comments
 (0)