Tone.js/Tone/signal/Zero.js
tambien 3d1202043a all modules are relative paths
simplifies deep references to individual files
2018-08-26 22:29:17 -04:00

37 lines
877 B
JavaScript

define(["../core/Tone", "../core/Gain", "../signal/SignalBase"], function(Tone){
/**
* @class Tone.Zero outputs 0's at audio-rate. The reason this has to be
* it's own class is that many browsers optimize out Tone.Signal
* with a value of 0 and will not process nodes further down the graph.
* @extends {Tone.SignalBase}
*/
Tone.Zero = function(){
Tone.SignalBase.call(this);
/**
* The gain node
* @type {Tone.Gain}
* @private
*/
this._gain = this.input = this.output = new Tone.Gain();
this.context.getConstant(0).connect(this._gain);
};
Tone.extend(Tone.Zero, Tone.SignalBase);
/**
* clean up
* @return {Tone.Zero} this
*/
Tone.Zero.prototype.dispose = function(){
Tone.SignalBase.prototype.dispose.call(this);
this._gain.dispose();
this._gain = null;
return this;
};
return Tone.Zero;
});