mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
jshint and jsdoc the merger
This commit is contained in:
parent
766951c8ae
commit
c4f8a98c2f
1 changed files with 27 additions and 11 deletions
|
@ -1,27 +1,43 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// MERGE
|
||||
//
|
||||
// Merge a left and a right into a single left/right channel
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
define(["Tone/core/Tone"], function(Tone){
|
||||
|
||||
/**
|
||||
* merge a left and a right channel into a single stereo channel
|
||||
*
|
||||
* instead of connecting to the input, connect to either the left, or right input
|
||||
*
|
||||
* default input for connect is left input
|
||||
*
|
||||
* @constructor
|
||||
* @extends {Tone}
|
||||
*/
|
||||
Tone.Merge = function(){
|
||||
|
||||
Tone.call(this);
|
||||
|
||||
//components
|
||||
this.left = this.context.createGain();
|
||||
/**
|
||||
* the left input channel
|
||||
* also an alias for the input
|
||||
* @type {GainNode}
|
||||
*/
|
||||
this.left = this.input;
|
||||
/**
|
||||
* the right input channel
|
||||
* @type {GainNode}
|
||||
*/
|
||||
this.right = this.context.createGain();
|
||||
/**
|
||||
* the merger node for the two channels
|
||||
* @type {ChannelMergerNode}
|
||||
*/
|
||||
this.merger = this.context.createChannelMerger(2);
|
||||
|
||||
//connections
|
||||
this.left.connect(this.merger, 0, 0);
|
||||
this.right.connect(this.merger, 0, 1);
|
||||
this.merger.connect(this.output);
|
||||
}
|
||||
};
|
||||
|
||||
Tone.extend(Tone.Merge);
|
||||
|
||||
return Tone.Merge;
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue