defined detune property on WebAudioSoundManager prototype

This commit is contained in:
Pavle Goloskokovic 2017-11-16 17:24:20 +01:00
parent 7d7d8a7c75
commit e456ee716b

View file

@ -101,4 +101,21 @@ Object.defineProperty(WebAudioSoundManager.prototype, 'rate', {
}, this); }, this);
} }
}); });
/**
* Global detune.
* @property {number} detune
*/
Object.defineProperty(WebAudioSoundManager.prototype, 'detune', {
get: function () {
return this._detune;
},
set: function (value) {
this._detune = value;
this.sounds.forEach(function (sound) {
// invoke sound's detune setter method to update
// value based on new global detune value
sound.detune = sound.detune;
}, this);
}
});
module.exports = WebAudioSoundManager; module.exports = WebAudioSoundManager;