2018-01-20 18:57:00 +00:00
|
|
|
var Class = require('../../utils/Class');
|
|
|
|
var EventEmitter = require('eventemitter3');
|
2018-01-20 19:10:16 +00:00
|
|
|
var NoAudioSound = require('./NoAudioSound');
|
2018-01-20 19:23:33 +00:00
|
|
|
var BaseSoundManager = require('../BaseSoundManager');
|
2018-01-20 19:24:46 +00:00
|
|
|
var NOOP = require('../../utils/NOOP');
|
2018-01-20 18:57:00 +00:00
|
|
|
var NoAudioSoundManager = new Class({
|
|
|
|
Extends: EventEmitter,
|
|
|
|
initialize: function NoAudioSoundManager(game) {
|
|
|
|
EventEmitter.call(this);
|
2018-01-20 18:59:19 +00:00
|
|
|
this.game = game;
|
2018-01-20 18:59:54 +00:00
|
|
|
this.sounds = [];
|
2018-01-20 19:00:21 +00:00
|
|
|
this.mute = false;
|
2018-01-20 19:00:36 +00:00
|
|
|
this.volume = 1;
|
2018-01-20 19:00:55 +00:00
|
|
|
this.rate = 1;
|
2018-01-20 19:01:09 +00:00
|
|
|
this.detune = 0;
|
2018-01-20 19:01:26 +00:00
|
|
|
this.pauseOnBlur = true;
|
2018-01-20 19:01:44 +00:00
|
|
|
this.locked = false;
|
2018-01-20 19:01:55 +00:00
|
|
|
this.unlocked = false;
|
2018-01-20 19:10:16 +00:00
|
|
|
},
|
|
|
|
add: function (key, config) {
|
|
|
|
var sound = new NoAudioSound(this, key, config);
|
|
|
|
this.sounds.push(sound);
|
|
|
|
return sound;
|
2018-01-20 19:11:48 +00:00
|
|
|
},
|
|
|
|
addAudioSprite: function (key, config) {
|
|
|
|
var sound = this.add(key, config);
|
|
|
|
sound.spritemap = {};
|
|
|
|
return sound;
|
2018-01-20 19:12:36 +00:00
|
|
|
},
|
|
|
|
play: function (key, extra) {
|
|
|
|
return false;
|
|
|
|
},
|
2018-01-20 19:13:14 +00:00
|
|
|
playAudioSprite: function (key, spriteName, config) {
|
|
|
|
return false;
|
2018-01-20 19:23:33 +00:00
|
|
|
},
|
|
|
|
remove: function (sound) {
|
|
|
|
return BaseSoundManager.prototype.remove.call(this, sound);
|
2018-01-20 19:24:10 +00:00
|
|
|
},
|
|
|
|
removeByKey: function (key) {
|
|
|
|
return BaseSoundManager.prototype.removeByKey.call(this, key);
|
2018-01-20 19:24:46 +00:00
|
|
|
},
|
2018-01-20 19:25:03 +00:00
|
|
|
pauseAll: NOOP,
|
|
|
|
resumeAll: NOOP
|
2018-01-20 18:57:00 +00:00
|
|
|
});
|
|
|
|
module.exports = NoAudioSoundManager;
|