What's new

UI Button setting Value of Slider

jfino

Active Member
Hello everyone!

Quick question:
I want to assign a value to a slider(s) using a button.

The slider controls several parameters.
In the below example its controlling the Volume.

When I press the button, the value for the slider updates but
the parameters that the slider controls don't update.
How do I make it update?

Thank you!!
Jimmy

Code:
on init
    declare ui_button $Button1
    declare ui_slider $slider1 (0,1000000)
end on

on ui_control ($Button1)
    $slider1:=500000
    {I could just put the set engine par here but imagine I have loads of sliders
    and each control several parameters, also there's several buttons with different values}
end on

on ui_control ($slider1) {slider1 of many}
    _set_engine_par($ENGINE_PAR_VOLUME, $slider1,-1,-1,-1)
      
end on
 
What might work is to write a function that calls the set_engine_par function, and then call that function from both callbacks.
 
Top Bottom