Skip to content

Commit 2f36439

Browse files
author
Tory Hoke
committed
Fix parameter management for Sugarcand and Jonah
Signed-off-by: Tory Hoke <tory@sub-q.com>
1 parent f243da4 commit 2f36439

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

sqTwineSound_sugarcane_jonah.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,22 @@ GNU General Public License for more details.
108108

109109
var args = Array.prototype.slice.call(givenArgs);
110110

111+
//alert(" split args " + args);
112+
//alert("typeof " + typeof(givenArgs[givenArgs.length-1]));
113+
//alert(givenArgs[givenArgs.length-1].fullArgs());
114+
115+
var tempArgs = [];
116+
111117
if (args.length > 2) {
112-
return args[2].toString().split(",");
118+
tempArgs = args[2].toString().split(",");
113119
}
114-
115-
return args;
120+
for (var i = 0; i < tempArgs.length; i++) {
121+
if (typeof(tempArgs[i]) == "string" && tempArgs[i].indexOf("$") === 0) {
122+
var varName = tempArgs[i].slice(1, tempArgs[i].length);
123+
if (state.history[0].variables.hasOwnProperty(varName)) tempArgs[i] = state.history[0].variables[varName];
124+
}
125+
}
126+
return tempArgs;
116127
}
117128

118129

@@ -471,7 +482,7 @@ GNU General Public License for more details.
471482
//
472483
function getSoundTrack(clipName) {
473484
clipName = cleanClipName(clipName.toString());
474-
if (!clips.hasOwnProperty(clipName)) { error("Given clipName " + clipName + " does not exist in this project. Please check your variable names."); }
485+
if (!clips.hasOwnProperty(clipName)) { return error("Given clipName " + clipName + " does not exist in this project. Please check your variable names."); }
475486
return clips[clipName];
476487
}
477488

@@ -613,7 +624,6 @@ GNU General Public License for more details.
613624
handler : function () {
614625

615626
var args = manageCommonArgs(arguments, [clipNameLabel]);
616-
617627
var soundtrack = getSoundTrack(args[0]);
618628
var volumeProportion = args[1] !== undefined ? args[1] : soundtrack.volumeProportion;
619629
soundtrack.overlap = args[2] !== undefined ? args[2] : defaultOverlap;

0 commit comments

Comments
 (0)