Is there a way to bypass the function of a ui_slider?

Hi there, Is there a way to bypass the function of a ui_slider with a button?
When the Button is active the function of the slider works when the Button is deactivated the slider function doesn't work.
I tried this but it has no function:
on init
declare ui_slider $COS(0, 795000)
make_persistent($COS)
declare $k_COS
$k_COS := get_ui_id($COS)
set_control_par_str($k_COS,$CONTROL_PAR_PICTURE,"cos")
set_control_par($k_COS,$CONTROL_PAR_POS_X,512)
set_control_par($k_COS,$CONTROL_PAR_POS_Y,141)
set_control_par($k_COS,$CONTROL_PAR_MOUSE_BEHAVIOUR,$mouse_resp)
declare ui_button $GRAPE
declare $slider_disabled
declare $CONTROL_PAR_DISABLE
$GRAPE := 0
make_persistent ($GRAPE)
declare $k_GRAPE
$k_HAZE := get_ui_id($GRAPE)
set_control_par_str($k_GRAPE,$CONTROL_PAR_TEXT,"")
set_control_par_str($k_GRAPE,$CONTROL_PAR_PICTURE,"GRAPE")
set_control_par($k_GRAPE,$CONTROL_PAR_POS_X,521)
set_control_par($k_GRAPE,$CONTROL_PAR_POS_Y,117)
set_control_par($k_GRAPE,$CONTROL_PAR_MOUSE_BEHAVIOUR,$mouse_resp)
end on
ui_control($GRAPE)
$slider_disabled := get_control_par($COS, $CONTROL_PAR_DISABLE)
if ($slider_disabled = 1)
set_control_par($COS, $CONTROL_PAR_DISABLE, 1)
$slider_disabled := 0
else
set_control_par($COS, $CONTROL_PAR_DISABLE, 0)
$slider_disabled := 1
end if
end on
Comments
-
Here's the basic idea. In the slider callback allow whatever it is supposed to do only when the button is 1:
on ui_control ($slider) // only let slider do what it is supposed to do then button is 1 if ($button = 1) //set_engine_par(...) or whatever end if end on
0 -
maybe you could help me with this:
that's what the slider do:
ui_control ($COS)
set_engine_par($ENGINE_PAR_VOLUME, $COS,2, -1, 0)
and then?
0 -
on ui_control ($cos)
if ($grape = 0)
set_engine_par($ENGINE_PAR_VOLUME, $COS,2, -1, 0)
$grape := 1
end if
end on
0 -
on ui_control ($cos)
if ($grape = 0)
set_engine_par($ENGINE_PAR_VOLUME, $COS,2, -1, 0)
$grape := 1
end if
end on
0 -
on ui_control ($cos) if ($grape = 0) set_engine_par($ENGINE_PAR_VOLUME, $COS,2, -1, 0) end if end on
0 -
this one works perfect now thanks 🙏🏼
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 63 NI News
- 795 Tech Talks
- 4.1K Native Access
- 16.7K Komplete
- 2K Komplete General
- 4.4K Komplete Kontrol
- 5.8K Kontakt
- 1.6K Reaktor
- 385 Battery 4
- 853 Guitar Rig & FX
- 431 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.4K Traktor
- 7.4K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators