mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
added decibels volume control to sources
This commit is contained in:
parent
b0b572f113
commit
2dbacd3310
1 changed files with 7 additions and 20 deletions
|
@ -28,6 +28,12 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Master"], function(T
|
|||
*/
|
||||
this.onended = options.onended;
|
||||
|
||||
/**
|
||||
* the volume of the output in decibels
|
||||
* @type {Tone.Signal}
|
||||
*/
|
||||
this.volume = new Tone.Signal(this.output.gain, Tone.Signal.Units.Decibels);
|
||||
|
||||
/**
|
||||
* keeps track of the timeout for chaning the state
|
||||
* and calling the onended
|
||||
|
@ -48,6 +54,7 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Master"], function(T
|
|||
*/
|
||||
Tone.Source.defaults = {
|
||||
"onended" : function(){},
|
||||
"volume" : 0,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -123,18 +130,6 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Master"], function(T
|
|||
Tone.Transport.unsyncSource(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* gets the setVolume method from {@link Tone.Master}
|
||||
* @method
|
||||
*/
|
||||
Tone.Source.prototype.setVolume = Tone.Master.setVolume;
|
||||
|
||||
/**
|
||||
* gets the getVolume method from {@link Tone.Master}
|
||||
* @method
|
||||
*/
|
||||
Tone.Source.prototype.getVolume = Tone.Master.getVolume;
|
||||
|
||||
/**
|
||||
* clean up
|
||||
* @return {Tone.Source} `this`
|
||||
|
@ -156,14 +151,6 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Master"], function(T
|
|||
this.onended();
|
||||
};
|
||||
|
||||
/**
|
||||
* the volume of the source
|
||||
* @memberOf Tone.Source#
|
||||
* @type {number}
|
||||
* @name volume
|
||||
*/
|
||||
Tone._defineGetterSetter(Tone.Source, "volume");
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue