mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-17 00:58:09 +00:00
36 lines
No EOL
812 B
JavaScript
36 lines
No EOL
812 B
JavaScript
define(["Tone/core/Tone"], function(Tone){
|
|
|
|
"use strict";
|
|
|
|
/**
|
|
* @class Base class for all Signals
|
|
*
|
|
* @constructor
|
|
* @extends {Tone}
|
|
*/
|
|
Tone.SignalBase = function(){
|
|
|
|
};
|
|
|
|
Tone.extend(Tone.SignalBase);
|
|
|
|
/**
|
|
* Signals can connect to other Signals
|
|
*
|
|
* @override
|
|
* @param {AudioParam|AudioNode|Tone.Signal|Tone} node
|
|
* @param {number} [outputNumber=0]
|
|
* @param {number} [inputNumber=0]
|
|
* @returns {Tone.SignalBase} `this`
|
|
*/
|
|
Tone.SignalBase.prototype.connect = function(node, outputNumber, inputNumber){
|
|
//zero it out so that the signal can have full control
|
|
if (node instanceof Tone.Signal || node instanceof AudioParam){
|
|
node.value = 0;
|
|
}
|
|
Tone.prototype.connect.call(this, node, outputNumber, inputNumber);
|
|
return this;
|
|
};
|
|
|
|
return Tone.SignalBase;
|
|
}); |