Many-value sliders up and running

*Captain's Log: Stardate 77571.3

I got a lot of work done today on multi-value sliders. I finally figured out what the new API needs to look like to make this possible, and the big refactoring that was needed to change over the calling code from the juce::Slider API to the new API is all done. I also ported the last couple of juce::Slider uses to PrecisionSlider, which required implementing snap-to-grid and some configurable style stuff (sometimes you only want the slider and no thumbwheel, and vice versa). And parts of the new many-value slider implementation itself is done. I suspect that I might even finish the whole project this week, which would be fantastic.

The key thing to make this many-value slider stuff work is that its state changed from just a float to a pair<float, float>, representing the lower and upper bounds of the full range of values being controlled by the slider. Moving the slider just moves this range around. And grabbing one end of the slider cap will move one end of the range around. In this case, the various values inside the range will be scaled to the same relative position within the new range.

I'm pretty excited about this, because it will make it much easier to work with systems that have non-uniform parameters, like a string where the springs get tighter towards one end. Now you'll be able to duplicate that string of masses, select the duplicate, and slide the spring stiffness higher, and all of the springs will get proportionally stiffer instead of all getting reset to a single new value.

There's a few more details to work out, like making this work how you expect for exponential sliders, dealing with sliders that turn into infinity at their extremes (e.g. compressor ratio), stuff like that. But that should all be pretty straightforward, I think.


© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal