Skip to content

Commit de1657d

Browse files
Updated comments with private and readonly descriptors
1 parent 0f6ac29 commit de1657d

4 files changed

Lines changed: 38 additions & 5 deletions

File tree

v3/src/sound/BaseSound.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var BaseSound = new Class({
88
/**
99
* Local reference to the sound manager.
1010
*
11+
* @private
1112
* @property {Phaser.Sound.BaseSoundManager} manager
1213
*/
1314
this.manager = manager;
@@ -20,16 +21,17 @@ var BaseSound = new Class({
2021
/**
2122
* [description]
2223
*
23-
* Duration set explicitly, rest of default values
24-
* will be set by other properties setters.
24+
* Default values will be set by properties' setters.
2525
*
26+
* @private
2627
* @property {ISoundConfig} config
2728
*/
2829
this.config = {};
2930
/**
3031
* Reference to the currently used config.
3132
* It could be default config or marker config.
3233
*
34+
* @private
3335
* @property {ISoundConfig} currentConfig
3436
*/
3537
this.currentConfig = this.config;
@@ -58,9 +60,6 @@ var BaseSound = new Class({
5860
* Represents detuning of sound in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).
5961
* The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).
6062
*
61-
* Standards based Web Audio implementation only.
62-
* Webkit Web Audio implementation and HTML5 Audio don't support this.
63-
*
6463
* @property {number} detune
6564
*/
6665
this.detune = 0;
@@ -109,31 +108,36 @@ var BaseSound = new Class({
109108
/**
110109
* Flag indicating if sound is currently playing.
111110
*
111+
* @readonly
112112
* @property {boolean} isPlaying
113113
*/
114114
this.isPlaying = false;
115115
/**
116116
* Flag indicating if sound is currently paused.
117117
*
118+
* @readonly
118119
* @property {boolean} isPaused
119120
*/
120121
this.isPaused = false;
121122
/**
122123
* Object containing markers definitions.
123124
*
125+
* @readonly
124126
* @property {{}} markers
125127
*/
126128
this.markers = {};
127129
/**
128130
* Currently playing marker.
129131
* 'null' if whole sound is playing.
130132
*
133+
* @readonly
131134
* @property {ISoundMarker} currentMarker
132135
*/
133136
this.currentMarker = null;
134137
/**
135138
* [description]
136139
*
140+
* @private
137141
* @property {Phaser.Tween}
138142
*/
139143
this.fadeTween = null; // TODO see how to use global tween
@@ -266,6 +270,9 @@ var BaseSound = new Class({
266270
fadeTo: function (volume, duration) {
267271
return null;
268272
},
273+
/**
274+
* @private
275+
*/
269276
update: NOOP,
270277
destroy: function () {
271278
},

v3/src/sound/BaseSoundManager.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var BaseSoundManager = new Class({
1313
/**
1414
* An array containing all added sounds.
1515
*
16+
* @private
1617
* @property {Array} sounds
1718
*/
1819
this.sounds = [];
@@ -89,6 +90,13 @@ var BaseSoundManager = new Class({
8990
this._detune = 0;
9091
},
9192
add: NOOP,
93+
/**
94+
* [description]
95+
*
96+
* @param {string} key
97+
* @param {ISoundConfig} config
98+
* @returns {IAudioSpriteSound}
99+
*/
92100
addAudioSprite: function (key, config) {
93101
var sound = this.add(key, config);
94102
/**
@@ -117,11 +125,18 @@ var BaseSoundManager = new Class({
117125
pauseAll: NOOP,
118126
resumeAll: NOOP,
119127
stopAll: NOOP,
128+
/**
129+
* @private
130+
*/
120131
onBlur: NOOP,
132+
/**
133+
* @private
134+
*/
121135
onFocus: NOOP,
122136
/**
123137
* Update method called on every game step.
124138
*
139+
* @private
125140
* @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
126141
* @param {number} delta - The delta time elapsed since the last frame.
127142
*/

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var WebAudioSound = new Class({
1010
/**
1111
* [description]
1212
*
13+
* @private
1314
* @property {AudioBuffer} audioBuffer
1415
*/
1516
this.audioBuffer = manager.game.cache.audio.get(key);
@@ -20,32 +21,37 @@ var WebAudioSound = new Class({
2021
/**
2122
* [description]
2223
*
24+
* @private
2325
* @property {AudioBufferSourceNode} source
2426
*/
2527
this.source = null;
2628
/**
2729
* [description]
2830
*
31+
* @private
2932
* @property {GainNode} muteNode
3033
*/
3134
this.muteNode = manager.context.createGain();
3235
/**
3336
* [description]
3437
*
38+
* @private
3539
* @property {GainNode} volumeNode
3640
*/
3741
this.volumeNode = manager.context.createGain();
3842
/**
3943
* The time the previous playback started at based on
4044
* BaseAudioContext.currentTime value.
4145
*
46+
* @private
4247
* @property {number} startTime
4348
*/
4449
this.startTime = 0;
4550
/**
4651
* Relative time when sound was paused.
4752
* Corresponds to the seek value at the time when pause() method was called on this sound.
4853
*
54+
* @private
4955
* @property {number} pausedTime
5056
*/
5157
this.pausedTime = 0;

v3/src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,28 @@ var WebAudioSoundManager = new Class({
1111
*
1212
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext
1313
*
14+
* @private
1415
* @property {boolean} webkit
1516
*/
1617
this.webkit = !!window['webkitAudioContext'] && !window['AudioContext'];
1718
/**
1819
* The AudioContext being used for playback.
1920
*
21+
* @private
2022
* @property {AudioContext} context
2123
*/
2224
this.context = this.createAudioContext(game);
2325
/**
2426
* [description]
2527
*
28+
* @private
2629
* @property {GainNode} masterMuteNode
2730
*/
2831
this.masterMuteNode = this.context.createGain();
2932
/**
3033
* [description]
3134
*
35+
* @private
3236
* @property {GainNode} masterVolumeNode
3337
*/
3438
this.masterVolumeNode = this.context.createGain();
@@ -37,6 +41,7 @@ var WebAudioSoundManager = new Class({
3741
/**
3842
* Destination node for connecting individual sounds to.
3943
*
44+
* @private
4045
* @property {AudioNode} destination
4146
*/
4247
this.destination = this.masterMuteNode;

0 commit comments

Comments
 (0)