Skip to content

Commit dcbc81e

Browse files
committed
Remove un-used properties and setters
1 parent 15c4334 commit dcbc81e

1 file changed

Lines changed: 2 additions & 132 deletions

File tree

src/sound/BaseSound.js

Lines changed: 2 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ var BaseSound = new Class({
137137
*/
138138
this.currentConfig = this.config;
139139

140+
this.config = Extend(this.config, config);
141+
140142
/**
141143
* Boolean indicating whether the sound is muted or not.
142144
* Gets or sets the muted state of this sound.
@@ -159,30 +161,6 @@ var BaseSound = new Class({
159161
*/
160162
this.volume = 1;
161163

162-
/**
163-
* Defines the speed at which the audio asset will be played.
164-
* Value of 1.0 plays the audio at full speed, 0.5 plays the audio
165-
* at half speed and 2.0 doubles the audio's playback speed.
166-
* This value gets multiplied by global rate to have the final playback speed.
167-
*
168-
* @name Phaser.Sound.BaseSound#rate
169-
* @type {number}
170-
* @default 1
171-
* @since 3.0.0
172-
*/
173-
this.rate = 1;
174-
175-
/**
176-
* Represents detuning of sound in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).
177-
* The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).
178-
*
179-
* @name Phaser.Sound.BaseSound#detune
180-
* @type {number}
181-
* @default 0
182-
* @since 3.0.0
183-
*/
184-
this.detune = 0;
185-
186164
/**
187165
* Property representing the position of playback for this sound, in seconds.
188166
* Setting it to a specific value moves current playback to that position.
@@ -205,7 +183,6 @@ var BaseSound = new Class({
205183
* @since 3.0.0
206184
*/
207185
this.loop = false;
208-
this.config = Extend(this.config, config);
209186

210187
/**
211188
* Object containing markers definitions.
@@ -527,113 +504,6 @@ var BaseSound = new Class({
527504
this.totalRate = this.currentConfig.rate * this.manager.rate * detuneRate;
528505
},
529506

530-
/**
531-
* @event Phaser.Sound.BaseSound#rate
532-
* @param {Phaser.Sound.BaseSound} sound - Reference to the sound that emitted the event.
533-
* @param {number} value - An updated value of Phaser.Sound.BaseSound#rate property.
534-
*/
535-
536-
/**
537-
* Sets the playback rate of this Sound.
538-
*
539-
* For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed
540-
* and 2.0 doubles the audios playback speed.
541-
*
542-
* @method Phaser.Sound.BaseSound#setRate
543-
* @fires Phaser.Sound.BaseSound#rate
544-
* @since 3.3.0
545-
*
546-
* @param {number} value - The playback rate at of this Sound.
547-
*
548-
* @return {Phaser.Sound.BaseSound} This Sound.
549-
*/
550-
setRate: function (value)
551-
{
552-
this.rate = value;
553-
554-
return this;
555-
},
556-
557-
/**
558-
* Rate at which this Sound will be played.
559-
* Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed
560-
* and 2.0 doubles the audios playback speed.
561-
*
562-
* @name Phaser.Sound.BaseSound#rate
563-
* @type {number}
564-
* @default 1
565-
* @since 3.0.0
566-
*/
567-
rate: {
568-
569-
get: function ()
570-
{
571-
return this.currentConfig.rate;
572-
},
573-
574-
set: function (value)
575-
{
576-
this.currentConfig.rate = value;
577-
578-
this.calculateRate();
579-
580-
this.emit('rate', this, value);
581-
}
582-
583-
},
584-
585-
/**
586-
* Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).
587-
* The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).
588-
*
589-
* @method Phaser.Sound.BaseSound#setDetune
590-
* @fires Phaser.Sound.BaseSound#detune
591-
* @since 3.3.0
592-
*
593-
* @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).
594-
*
595-
* @return {Phaser.Sound.BaseSound} This Sound.
596-
*/
597-
setDetune: function (value)
598-
{
599-
this.detune = value;
600-
601-
return this;
602-
},
603-
604-
/**
605-
* @event Phaser.Sound.BaseSound#detune
606-
* @param {Phaser.Sound.BaseSound} sound - Reference to the Sound that emitted event.
607-
* @param {number} value - An updated value of Phaser.Sound.BaseSound#detune property.
608-
*/
609-
610-
/**
611-
* The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).
612-
* The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).
613-
*
614-
* @name Phaser.Sound.BaseSound#detune
615-
* @type {number}
616-
* @default 0
617-
* @since 3.0.0
618-
*/
619-
detune: {
620-
621-
get: function ()
622-
{
623-
return this.currentConfig.detune;
624-
},
625-
626-
set: function (value)
627-
{
628-
this.currentConfig.detune = value;
629-
630-
this.calculateRate();
631-
632-
this.emit('detune', this, value);
633-
}
634-
635-
},
636-
637507
/**
638508
* Destroys this sound and all associated events and marks it for removal from the sound manager.
639509
*

0 commit comments

Comments
 (0)