@aaronventure
"Are you using look and feel or paint routine for these controls? If so, are you setting the value somewhere and not calling sendRepaintMessage() / repaintImmediately() after doing so (because reopening the GUI redraws the entire GUI and results in the correct display)?"
This could be it i will check that!
only thing i do differently is that i have two states/ranges. One goes the whole ms and the other one is 0-18 to make use of the time divisions.
I assume its just missing a repaint for the LAF part - hope thats it, will check :)
//2
//Sync Unsync Button
const var SYNC2 = Content.getComponent("Buttonsync1");
const var Knob7 = Content.getComponent("Knob7");
const var Knob8 = Content.getComponent("Knob8");
Content.setPropertiesFromJSON("Knob7", {
"mode": "TempoSync",
"stepSize": 1,
});
Content.setPropertiesFromJSON("Knob8", {
"mode": "TempoSync",
"stepSize": 1,
});
inline function onKnob7Control(component, value)
{
GRAINS.setAttribute(GRAINS.SpeedL, value);
}
Content.getComponent("Knob7").setControlCallback(onKnob7Control);
inline function onKnob8Control(component, value)
{
GRAINS.setAttribute(GRAINS.SpeedR, value);
}
Content.getComponent("Knob8").setControlCallback(onKnob8Control);
inline function onSYNC2Control(component, value)
{
GRAINS.setAttribute(GRAINS.TempoSync, value);
if(value)
{
// Switch the knob to tempo sync mode
Knob7.set("mode", "TempoSync");
Knob7.set("min", 0);
Knob7.set("max", 18);
Knob7.set("stepSize", 1);
//Knob4.set("middlePosition", 250);
// Switch the knob to tempo sync mode
Knob8.set("mode", "TempoSync");
Knob8.set("min", 0);
Knob8.set("max", 18);
Knob8.set("stepSize", 1);
//Knob4.set("middlePosition", 250);
}
else
{
// Switch the knob to frequency mode
Knob7.set("mode", "Time");
Knob7.set("min", 0);
Knob7.set("max", 1000);
Knob7.set("middlePosition", 500);
Knob7.set("stepSize", 1);
// Switch the knob to frequency mode
Knob8.set("mode", "Time");
Knob8.set("min", 0);
Knob8.set("max", 1000);
Knob8.set("middlePosition", 500);
Knob8.set("stepSize", 1);
}
Knob7.setValue(GRAINS.getAttribute(GRAINS.SpeedL));
Knob8.setValue(GRAINS.getAttribute(GRAINS.SpeedR));
}
Content.getComponent("Buttonsync1").setControlCallback(onSYNC2Control);