2014-12-01 04:26:06 +00:00
|
|
|
define(["Tone/core/Tone"], function(Tone){
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @class Base class for all Signals
|
|
|
|
*
|
|
|
|
* @constructor
|
2014-12-02 05:27:28 +00:00
|
|
|
* @extends {Tone}
|
2014-12-01 04:26:06 +00:00
|
|
|
*/
|
|
|
|
Tone.SignalBase = function(){
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Tone.extend(Tone.SignalBase);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signals can connect to other Signals
|
|
|
|
*
|
|
|
|
* @override
|
|
|
|
* @param {AudioParam|AudioNode|Tone.Signal|Tone} node
|
2014-12-02 06:42:08 +00:00
|
|
|
* @param {number} [outputNumber=0]
|
|
|
|
* @param {number} [inputNumber=0]
|
2015-02-02 03:56:33 +00:00
|
|
|
* @returns {Tone.SignalBase} `this`
|
2014-12-01 04:26:06 +00:00
|
|
|
*/
|
|
|
|
Tone.SignalBase.prototype.connect = function(node, outputNumber, inputNumber){
|
|
|
|
//zero it out so that the signal can have full control
|
2015-02-06 22:47:26 +00:00
|
|
|
if (node instanceof Tone.Signal || node instanceof AudioParam){
|
2014-12-01 04:26:06 +00:00
|
|
|
node.value = 0;
|
|
|
|
}
|
|
|
|
Tone.prototype.connect.call(this, node, outputNumber, inputNumber);
|
2015-02-02 03:56:33 +00:00
|
|
|
return this;
|
2014-12-01 04:26:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return Tone.SignalBase;
|
|
|
|
});
|