Skip to content

Commit 7f3a187

Browse files
Spongmantherewasaguy
authored andcommitted
yuidoc fixes (#199)
* yuidoc @type fixes * more @type fixes * docs: AudioIn.start parameters are optional * docs: specify correct @Class for helpers * more yuidoc fixes * docs, use '...' to specify varargs
1 parent d9db5b4 commit 7f3a187

16 files changed

+68
-61
lines changed

src/audioin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ define(function (require) {
9191
* the browser won't provide mic access.
9292
*
9393
* @method start
94-
* @param {Function} successCallback Name of a function to call on
94+
* @param {Function} [successCallback] Name of a function to call on
9595
* success.
96-
* @param {Function} errorCallback Name of a function to call if
96+
* @param {Function} [errorCallback] Name of a function to call if
9797
* there was an error. For example,
9898
* some browsers do not support
9999
* getUserMedia.

src/compressor.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,10 @@ define(function (require) {
6464
};
6565

6666

67-
6867
/**
69-
* Setter and Getter methdds
70-
* @method {attack} set attack w/ time ramp or get current attack
71-
* @method {knee} set knee w/ time ramp or get current knee
72-
* @method {ratio} set ratio w/ time ramp or get current ratio
73-
* @method {threshold} set threshold w/ time ramp or get current threshold
74-
* @method {release} set release w/ time ramp or get current release
68+
* set attack w/ time ramp or get current attack
69+
* @method attack
7570
*/
76-
7771
p5.Compressor.prototype.attack = function (attack, time){
7872
var t = time || 0;
7973
if (typeof attack == 'number'){
@@ -87,6 +81,10 @@ define(function (require) {
8781
};
8882

8983

84+
/**
85+
* set knee w/ time ramp or get current knee
86+
* @method knee
87+
*/
9088
p5.Compressor.prototype.knee = function (knee, time){
9189
var t = time || 0;
9290
if (typeof knee == 'number'){
@@ -100,6 +98,10 @@ define(function (require) {
10098
};
10199

102100

101+
/**
102+
* set ratio w/ time ramp or get current ratio
103+
* @method ratio
104+
*/
103105
p5.Compressor.prototype.ratio = function (ratio, time){
104106
var t = time || 0;
105107
if (typeof ratio == 'number'){
@@ -113,6 +115,10 @@ define(function (require) {
113115
};
114116

115117

118+
/**
119+
* set threshold w/ time ramp or get current threshold
120+
* @method threshold
121+
*/
116122
p5.Compressor.prototype.threshold = function (threshold, time){
117123
var t = time || 0;
118124
if (typeof threshold == 'number'){
@@ -126,6 +132,10 @@ define(function (require) {
126132
};
127133

128134

135+
/**
136+
* set release w/ time ramp or get current release
137+
* @method release
138+
*/
129139
p5.Compressor.prototype.release = function (release, time){
130140
var t = time || 0;
131141
if (typeof release == 'number'){

src/delay.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,15 @@ define(function (require) {
6767
* <a href="http://www.w3.org/TR/webaudio/#DelayNode">
6868
* Web Audio Delay Nodes</a>, one for each stereo channel.
6969
*
70-
* @property leftDelay
71-
* @type {Object} Web Audio Delay Node
70+
* @property leftDelay {Object} Web Audio Delay Node
7271
*/
7372
this.leftDelay = this.ac.createDelay();
7473
/**
7574
* The p5.Delay is built with two
7675
* <a href="http://www.w3.org/TR/webaudio/#DelayNode">
7776
* Web Audio Delay Nodes</a>, one for each stereo channel.
7877
*
79-
* @property rightDelay
80-
* @type {Object} Web Audio Delay Node
78+
* @property rightDelay {Object} Web Audio Delay Node
8179
*/
8280
this.rightDelay = this.ac.createDelay();
8381

src/distortion.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ define(function (require) {
5959
* <a href="http://www.w3.org/TR/webaudio/#WaveShaperNode">
6060
* Web Audio WaveShaper Node</a>.
6161
*
62-
* @property WaveShaperNode
63-
* @type {Object} AudioNode
62+
* @property WaveShaperNode {Object} AudioNode
6463
*/
6564
this.waveShaperNode = this.ac.createWaveShaper();
6665

@@ -87,7 +86,6 @@ define(function (require) {
8786
* @param {Number} [amount=0.25] Unbounded distortion amount.
8887
* Normal values range from 0-1.
8988
* @param {String} [oversample='none'] 'none', '2x', or '4x'.
90-
* @param {String}
9189
*/
9290
p5.Distortion.prototype.set = function(amount, oversample) {
9391
if (amount) {

src/effect.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ define(function (require) {
2323
/**
2424
* The p5.Effect class is built
2525
* using Tone.js CrossFade
26-
* @property _drywet
27-
* @type {Object} ToneJS node
26+
* @property _drywet {Object} ToneJS node
2827
*/
2928
this._drywet = new CrossFade(1);
3029

3130
/**
3231
* In classes that extend
3332
* p5.Effect, connect effect nodes
3433
* to the wet parameter
35-
* @property wet
36-
* @type {Object} Web Audio Gain Node
34+
* @property wet {Object} Web Audio Gain Node
3735
*/
3836
this.wet = this.ac.createGain();
3937

@@ -126,7 +124,7 @@ define(function (require) {
126124
* May be used with open-ended number of arguments
127125
*
128126
* @method chain
129-
* @param {Object} arguments p5.Effect objects
127+
* @param {Object} [...effects] p5.Effect objects
130128
*/
131129
p5.Effect.prototype.chain = function(){
132130
if (arguments.length>0){

src/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ define(function (require) {
368368
* control all of them.
369369
*
370370
* @method setInput
371-
* @param {Object} unit A p5.sound object or
371+
* @param {Object} [...inputs] A p5.sound object or
372372
* Web Audio Param.
373373
*/
374374
p5.Env.prototype.setInput = function() {

src/filter.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ define(function (require) {
2222
*
2323
* @class p5.Filter
2424
* @constructor
25-
* @param {[String]} type 'lowpass' (default), 'highpass', 'bandpass'
25+
* @param {String} [type] 'lowpass' (default), 'highpass', 'bandpass'
2626
* @return {Object} p5.Filter
2727
* @example
2828
* <div><code>
@@ -86,8 +86,7 @@ define(function (require) {
8686
* <a href="http://www.w3.org/TR/webaudio/#BiquadFilterNode">
8787
* Web Audio BiquadFilter Node</a>.
8888
*
89-
* @property biquadFilter
90-
* @type {Object} Web Audio Delay Node
89+
* @property biquadFilter {Object} Web Audio Delay Node
9190
*/
9291

9392
this.biquad = this.ac.createBiquadFilter();
@@ -109,8 +108,8 @@ define(function (require) {
109108
*
110109
* @method process
111110
* @param {Object} Signal An object that outputs audio
112-
* @param {[Number]} freq Frequency in Hz, from 10 to 22050
113-
* @param {[Number]} res Resonance/Width of the filter frequency
111+
* @param {Number} [freq] Frequency in Hz, from 10 to 22050
112+
* @param {Number} [res] Resonance/Width of the filter frequency
114113
* from 0.001 to 1000
115114
*/
116115
p5.Filter.prototype.process = function(src, freq, res, time) {
@@ -123,8 +122,8 @@ define(function (require) {
123122
* Set the frequency and the resonance of the filter.
124123
*
125124
* @method set
126-
* @param {Number} freq Frequency in Hz, from 10 to 22050
127-
* @param {Number} res Resonance (Q) from 0.001 to 1000
125+
* @param {Number} [freq] Frequency in Hz, from 10 to 22050
126+
* @param {Number} [res] Resonance (Q) from 0.001 to 1000
128127
* @param {Number} [timeFromNow] schedule this event to happen
129128
* seconds from now
130129
*/
@@ -193,7 +192,7 @@ define(function (require) {
193192
* "allpass".
194193
*
195194
* @method setType
196-
* @param {String}
195+
* @param {String} t
197196
*/
198197
p5.Filter.prototype.setType = function(t) {
199198
this.biquad.type = t;
@@ -214,7 +213,8 @@ define(function (require) {
214213
* its method <code>setType('lowpass')</code>.
215214
* See p5.Filter for methods.
216215
*
217-
* @method p5.LowPass
216+
* @method LowPass
217+
* @for p5
218218
*/
219219
p5.LowPass = function() {
220220
p5.Filter.call(this, 'lowpass');
@@ -227,7 +227,8 @@ define(function (require) {
227227
* its method <code>setType('highpass')</code>.
228228
* See p5.Filter for methods.
229229
*
230-
* @method p5.HighPass
230+
* @method HighPass
231+
* @for p5
231232
*/
232233
p5.HighPass = function() {
233234
p5.Filter.call(this, 'highpass');
@@ -240,7 +241,8 @@ define(function (require) {
240241
* its method <code>setType('bandpass')</code>.
241242
* See p5.Filter for methods.
242243
*
243-
* @method p5.BandPass
244+
* @method BandPass
245+
* @for p5
244246
*/
245247
p5.BandPass = function() {
246248
p5.Filter.call(this, 'bandpass');

src/helpers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict';
22
define(function (require) {
33
var p5sound = require('master');
4+
/**
5+
* @class p5
6+
*/
47

58
/**
69
* Returns a number representing the sample rate, in samples per second,
@@ -73,8 +76,7 @@ define(function (require) {
7376
* converter.
7477
*
7578
* @method soundFormats
76-
* @param {String} formats i.e. 'mp3', 'wav', 'ogg'
77-
* @param {String} formats i.e. 'mp3', 'wav', 'ogg'
79+
* @param {String} [...formats] i.e. 'mp3', 'wav', 'ogg'
7880
* @example
7981
* <div><code>
8082
* function preload() {

src/looper.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ define(function (require) {
102102
* strings, or an object with multiple parameters.
103103
* Zero (0) indicates a rest.
104104
*
105-
* @property sequence
106-
* @type {Array}
105+
* @property sequence {Array}
107106
*/
108107
this.sequence = sequence;
109108
};
@@ -390,7 +389,7 @@ define(function (require) {
390389
*
391390
* @class p5.Score
392391
* @constructor
393-
* @param {p5.Part} part(s) One or multiple parts, to be played in sequence.
392+
* @param {p5.Part} [...parts] One or multiple parts, to be played in sequence.
394393
* @return {p5.Score}
395394
*/
396395
p5.Score = function() {

src/master.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ define(function () {
111111
* Web Audio API nodes including a dyanmicsCompressor (<code>.limiter</code>),
112112
* and Gain Nodes for <code>.input</code> and <code>.output</code>.
113113
*
114-
* @property soundOut
115-
* @type {Object}
114+
* @property soundOut {Object}
116115
*/
117116
p5.prototype.soundOut = p5.soundOut = p5sound;
118117

0 commit comments

Comments
 (0)