Skip to content

Commit

Permalink
returning to previous typechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
tambien committed Jan 29, 2019
1 parent bf5d1ac commit 5f67d0d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Tone/core/Tone.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,17 @@ Tone.prototype.set = function(params, value){
if (Tone.isUndef(param)){
continue;
}
if (Tone.isDefined(param.value)){
if ((Tone.Signal && param instanceof Tone.Signal) ||
(Tone.Param && param instanceof Tone.Param)){
if (param.value !== value){
param.value = value;
}
} else if (param instanceof AudioParam){
if (param.value !== value){
param.value = value;
}
} else if (Tone.TimeBase && param instanceof Tone.TimeBase){
parent[attr] = value;
} else if (param instanceof Tone){
param.set(value);
} else if (param !== value){
Expand Down Expand Up @@ -157,12 +164,13 @@ Tone.prototype.get = function(params){
attr = attrSplit[attrSplit.length - 1];
}
var param = parent[attr];
if (Tone.isUndef(param)){
continue;
}
if (Tone.isObject(params[attr])){
subRet[attr] = param.get();
} else if (Tone.isDefined(param.value)){
} else if (Tone.Signal && param instanceof Tone.Signal){
subRet[attr] = param.value;
} else if (Tone.Param && param instanceof Tone.Param){
subRet[attr] = param.value;
} else if (param instanceof AudioParam){
subRet[attr] = param.value;
} else if (param instanceof Tone){
subRet[attr] = param.get();
Expand Down

0 comments on commit 5f67d0d

Please sign in to comment.