Skip to content

Commit 2903417

Browse files
Defining detune property on a BaseSound class since it's the shared behaviour between subclasses
1 parent 15f2717 commit 2903417

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/sound/BaseSound.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,4 +419,20 @@ Object.defineProperty(BaseSound.prototype, 'rate', {
419419
this.events.dispatch(new SoundValueEvent(this, 'SOUND_RATE', value));
420420
}
421421
});
422+
/**
423+
* Detuning of sound.
424+
*
425+
* @name Phaser.Sound.BaseSound#detune
426+
* @property {number} detune
427+
*/
428+
Object.defineProperty(BaseSound.prototype, 'detune', {
429+
get: function () {
430+
return this.currentConfig.detune;
431+
},
432+
set: function (value) {
433+
this.currentConfig.detune = value;
434+
this.setRate();
435+
this.events.dispatch(new SoundValueEvent(this, 'SOUND_DETUNE', value));
436+
}
437+
});
422438
module.exports = BaseSound;

0 commit comments

Comments
 (0)