fixing disconnect from nonzero input/output

This commit is contained in:
Yotam Mann 2017-05-01 15:49:35 -04:00
parent 8883b80306
commit ceb209313e

View file

@ -380,10 +380,8 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline"], function (
//replace the old connect method
function toneConnect(B, outNum, inNum){
if (B.input){
if (Array.isArray(B.input)){
if (Tone.isUndef(inNum)){
inNum = 0;
}
inNum = Tone.defaultArg(inNum, 0);
if (Tone.isArray(B.input)){
this.connect(B.input[inNum]);
} else {
this.connect(B.input, outNum, inNum);
@ -403,11 +401,9 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline"], function (
//replace the old disconnect method
function toneDisconnect(B, outNum, inNum){
if (B && B.input && Array.isArray(B.input)){
if (Tone.isUndef(inNum)){
inNum = 0;
}
this.disconnect(B.input[inNum], outNum, inNum);
if (B && B.input && Tone.isArray(B.input)){
inNum = Tone.defaultArg(inNum, 0);
this.disconnect(B.input[inNum], outNum, 0);
} else if (B && B.input){
this.disconnect(B.input, outNum, inNum);
} else {