Defining detune property on a BaseSound class since it's the shared behaviour between subclasses

This commit is contained in:
Pavle Goloskokovic 2018-01-11 17:24:53 +01:00
parent 15f2717e9b
commit 2903417798

View file

@ -419,4 +419,20 @@ Object.defineProperty(BaseSound.prototype, 'rate', {
this.events.dispatch(new SoundValueEvent(this, 'SOUND_RATE', value));
}
});
/**
* Detuning of sound.
*
* @name Phaser.Sound.BaseSound#detune
* @property {number} detune
*/
Object.defineProperty(BaseSound.prototype, 'detune', {
get: function () {
return this.currentConfig.detune;
},
set: function (value) {
this.currentConfig.detune = value;
this.setRate();
this.events.dispatch(new SoundValueEvent(this, 'SOUND_DETUNE', value));
}
});
module.exports = BaseSound;