2015-08-31 20:59:36 +00:00
|
|
|
define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/core/Gain"], function(Tone){
|
2015-03-24 20:30:04 +00:00
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/**
|
2015-07-02 00:19:58 +00:00
|
|
|
* @class Tone.Volume is a simple volume node, useful for creating a volume fader.
|
2015-03-24 20:30:04 +00:00
|
|
|
*
|
|
|
|
* @extends {Tone}
|
|
|
|
* @constructor
|
2015-06-20 19:50:57 +00:00
|
|
|
* @param {Decibels} [volume=0] the initial volume
|
2015-03-24 20:30:04 +00:00
|
|
|
* @example
|
2015-06-14 05:09:06 +00:00
|
|
|
* var vol = new Tone.Volume(-12);
|
|
|
|
* instrument.chain(vol, Tone.Master);
|
2015-03-24 20:30:04 +00:00
|
|
|
*/
|
2015-08-28 22:32:32 +00:00
|
|
|
Tone.Volume = function(){
|
|
|
|
|
2015-10-21 14:30:21 +00:00
|
|
|
var options = this.optionsObject(arguments, ["value"], Tone.Volume.defaults);
|
2015-03-24 20:30:04 +00:00
|
|
|
|
2015-10-21 14:30:21 +00:00
|
|
|
Tone.Gain.call(this, options.value, Tone.Type.Decibels);
|
2015-03-24 20:30:04 +00:00
|
|
|
};
|
|
|
|
|
2015-10-21 14:30:21 +00:00
|
|
|
Tone.extend(Tone.Volume, Tone.Gain);
|
2015-03-24 20:30:04 +00:00
|
|
|
|
2015-08-28 22:32:32 +00:00
|
|
|
/**
|
|
|
|
* Defaults
|
|
|
|
* @type {Object}
|
|
|
|
* @const
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
Tone.Volume.defaults = {
|
2015-10-21 14:30:21 +00:00
|
|
|
"value" : 0
|
2015-03-24 20:30:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return Tone.Volume;
|
|
|
|
});
|