phaser/src/sound/noaudio/NoAudioSoundManager.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

var Class = require('../../utils/Class');
var EventEmitter = require('eventemitter3');
var NoAudioSound = require('./NoAudioSound');
var BaseSoundManager = require('../BaseSoundManager');
var NOOP = require('../../utils/NOOP');
var NoAudioSoundManager = new Class({
Extends: EventEmitter,
initialize: function NoAudioSoundManager(game) {
EventEmitter.call(this);
this.game = game;
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;
this.pauseOnBlur = true;
2018-01-20 19:01:44 +00:00
this.locked = false;
this.unlocked = false;
},
add: function (key, config) {
var sound = new NoAudioSound(this, key, config);
this.sounds.push(sound);
return sound;
},
addAudioSprite: function (key, config) {
var sound = this.add(key, config);
sound.spritemap = {};
return sound;
},
play: function (key, extra) {
return false;
},
playAudioSprite: function (key, spriteName, config) {
return false;
},
remove: function (sound) {
return BaseSoundManager.prototype.remove.call(this, sound);
},
removeByKey: function (key) {
return BaseSoundManager.prototype.removeByKey.call(this, key);
},
pauseAll: NOOP
});
module.exports = NoAudioSoundManager;