Request: (rotary) Slider needs an extra-value for the start-point of visualisation


#1

Sliders needs extra-value for the start-point of visualisation, an good example is a pan-slider.

Its only the value (get/Setter functions) which needs to be stored, the rest can be done via the look and feel classes


#2

That is a nice enhancement, but meanwhile you can achieve this also only the look and feel (but not adjustable).
I changed in LookAndFeel_V2::drawRotarySlider:

    {
        Path filledArc;
        filledArc.addPieSegment (rx, ry, rw, rw, rotaryStartAngle, angle, thickness);
        g.fillPath (filledArc);
    }

to be

    {
        Path filledArc;
        const float rotaryMidAngle = 0.5f * (rotaryStartAngle + rotaryEndAngle);
        if (angle > rotaryMidAngle)
            filledArc.addPieSegment (rx, ry, rw, rw, rotaryMidAngle, angle, thickness);
        else
            filledArc.addPieSegment (rx, ry, rw, rw, angle, rotaryMidAngle, thickness);
        g.fillPath (filledArc);
    }

The drawback is, you need an extra lookandfeel just for the pan button, so your addition to have the rotaryMidAngle adjustable would be nice. Could be either also in radians or between 0…1.


#3

Thanks! Yes thats my plan, but it would be great if something like this will be inluded in Juce.

slider->setPieSegmentMidAngle(…)
slider->getPieSegmentMidAngle()


#4

request: the slider-class needs the variable and get/set function for storing such value.
PS: yes i could subclass slider, but it feels quirky to retrieve the value via dynamic_cast inside the Look&Feel method


#5

You can store any data in NamedValueSet that you can access with Component::getProperties(). Then you can check if properties contains the requested key and use it’s value.

  • Jussi

#6

Thanks for the hint, yes i know (but this is a request :wink: