1 Knob for several value
-
I tried CB.setValue (1);
CB.changed ();
but I am sure it is a beautiful mistake. -
-
what did you have against the number 1? ^^
no it obviously has to change but I admit that I don't know -
@yall Do you want it to change to the knob's value?
-
inline function onKnob1Control(component, value)
{
if(value == 0)
{
CB.setValue(1);
}if(value == 1) { CB.setValue(2); }
};
Content.getComponent("Knob1").setControlCallback(onKnob1Control);
i understand i know
-
@d-healey
I just got there, I didn't put the .changed
thank you .
you won 1 week of vacation with me in the south of France (facing the sea;)) -
Well done!
I'll show you a slightly more efficient way that will only use one line in the callback
CB.setValue(value + 1);
-
-
even simpler. yet these are things that I see often, I understand them but I don't have the reflex to apply them correctly.
thanks a lot
-
@yall said in 1 Knob for several value:
I don't have the reflex to apply them correctly.
It just takes practice. Read lots of code and write lots of code and you'll pick these things up.
One tip, if you find you are writing the same thing multiple times then there is probably a more efficient solution.
-
@d-healey yes I try more and more to write the codes with what I learn rather than doing stupid copy paste. I am creating a github to host my projects in order to sell them with the open license and I will send you all of this. you will surely be surprised for a little beginner Like me ^^