SliderPackLAF
-
@DanH
valuethe slider index not the slider value - you know how to get the value because you're doing it on the next line ;)component.getSliderValueAt(value) -
@d-healey yes, it wasn't working and I wondered if I was doing it wrong, hence the v in the wrong place. In any case, I can't do:
inline function onSliderPack_NOTE_LENGTH_UIControl(component, value) { SliderPack_NOTE_LENGTH.setSliderAtIndex(value, component.getSliderValueAt(value / 100)); }; Content.getComponent("SliderPack_NOTE_LENGTH_UI").setControlCallback(onSliderPack_NOTE_LENGTH_UIControl);either...
EDIT - I can do:
inline function onSliderPack_NOTE_LENGTH_UIControl(component, value) { local v = component.getSliderValueAt(value); SliderPack_NOTE_LENGTH.setSliderAtIndex(value, component.getSliderValueAt(v / 100)); }; Content.getComponent("SliderPack_NOTE_LENGTH_UI").setControlCallback(onSliderPack_NOTE_LENGTH_UIControl);but the linked sliderpack doesn't read the value properly
-
@DanH
component.getSliderValueAt(v / 100)Do you have 100 sliders? -
@d-healey no
right I'm getting confused, obviously. 32 sliders. I just want to send the value of the sliderpack / 100 to the next sliderpack -
@DanH Why not set both sliderpacks to use a range of 0 - 1 and then multiply the value for display purposes in your LAF function?
-
@d-healey because I'm using CSS, which can't multiply a value.
-
@DanH Ah i see,
So the slider value you want is:
local v = component.getSliderValueAt(value) / 100;Then you can set the other sliderpack with:
myOtherSliderPack.setSliderAtIndex(value, v); -
@d-healey yes, that's what I expected to work, but the value received is still 0-100. Let me make a minimal snippet
-
@d-healey right, don't worry, finally got the right combo
thanks! -
@DanH
cool! Thank you!