Crash Issue - Help!
-
I've managed to whittle down a crash issue to the below lines of code. Before I spend some time making a snippet of it all, can anyone see anything obviously wrong with the code as it is?
// INDIVIDUAL BYPASSES inline function onBypassButtonsControl(component, value) { var btnIdx = ONOFFARRAY.indexOf(component); // Which button has been clicked SBARRAY[btnIdx].setValue(value); // Set the corresponding module bypass SBARRAY[btnIdx].changed(); bypassArray[btnIdx] = value; // Store the individual states }; for (b in ONOFFARRAY) b.setControlCallback(onBypassButtonsControl); inline function onSOLOControl(component, value) { for (i=0; i<ONOFFARRAY.length; i++) { if (value) // If Master bypass ON { SBARRAY[i].setValue(true); // Set all to bypass SBARRAY[i].changed(); //ONOFFARRAY[i].setValue(true); } else { SBARRAY[i].setValue(bypassArray[i]); // Or restore their state from the array SBARRAY[i].changed(); //ONOFFARRAY[i].setValue(bypassArray[i]); } } }; Content.getComponent("SOLO").setControlCallback(onSOLOControl);
Many thanks!
-
@danh said in Crash Issue - Help!:
for (b in ONOFFARRAY) b.setControlCallback(onBypassButtonsControl);
Put this on two lines (it won't fix the crash but it will be easier to read)
var btnIdx = ONOFFARRAY.indexOf(component);
Don't use
var
, uselocal
- this could be causing the crash if you have another var somewhere with the same name (but I doubt this is the cause). -
@DanH -this is the mute/solo mixer problem isnt it? David has a couple of videos on how to make this efficiently...
-
@d-healey thanks David, so far so good :) Can't believe changing var to local might fix weeks of grief! Let's hope so!
-
This post is deleted! -
@danh said in Crash Issue - Help!:
changing var to local
Make sure you change all of your
vars
inside inline functions, not just the ones in the bit of code you posted. -
@lindon thanks, will check it out :)
-
@d-healey yeah pretty certain I clocked that early on, managed to miss it here...