trinSound.js 838 B

1
  1. function TrinSound() { this.name = name; this.snd = snd; } TrinSound.prototype = { SOUNDS: [], add: function(snd) { this.SOUNDS[snd.info.name] = snd; }, get: function(name) { if (this.SOUNDS[name] === undefined) { return null; } return this.SOUNDS[name]; }, muteAll: function() { var sounds = TrinSound.prototype.SOUNDS; for (var key in sounds) { if (sounds.hasOwnProperty(key)) { TrinSound.prototype.get(key).pause(); } } }, unMuteAll: function() { var sounds = TrinSound.prototype.SOUNDS; for (var key in sounds) { if (sounds.hasOwnProperty(key)) { TrinSound.prototype.get(key).play(); } } }, soundsLoaded: false };