Source/PluginEditor.cpp
//This function is to draw the sliders created

This function is to draw the sliders created
This function is to draw the sliders created
void RotarySliderWithLabels::paint(juce::Graphics &g)
{
    using namespace juce;
    auto startAng = degreesToRadians(180.f + 45.f); 
    auto endAng = degreesToRadians(180.f - 45.f) + MathConstants<float>::twoPi; 
    auto range = getRange();
    auto sliderBounds = getSliderBounds();
    g.setColour(Colours::red);
    g.drawRect(getLocalBounds());
    g.setColour(Colours::yellow);
    g.drawRect(sliderBounds);
    getLookAndFeel().drawRotarySlider(g,
                                      sliderBounds.getX(),
                                      sliderBounds.getY(),
                                      sliderBounds.getWidth(),
                                      sliderBounds.getHeight(),
                                      jmap(getValue(), range.getStart(), range.getEnd(), 0.0, 1.0), 
                                      startAng,
                                      endAng,
                                      *this);
    auto center = sliderBounds.toFloat().getCentre();
    auto radius = sliderBounds.getWidth() * 0.5f;
    g.setColour(Colour(0u, 172u, 1u)); 
    g.setFont(getTextHeight());
    auto numChoices = labels.size();
    for( int i = 0; i < numChoices; ++i )
    {
        auto pos = labels[i].pos;
        jassert(0.f <= pos);
        jassert(pos <= 1.f);
        auto ang = jmap(pos, 0.f, 1.f, startAng, endAng);
        auto c = center.getPointOnCircumference(radius + getTextHeight() * 0.5f + 1, ang); 
        Rectangle<float> r;
        auto str = labels[i].label;
        r.setSize(g.getCurrentFont().getStringWidth(str), getTextHeight());
        r.setCentre(c);
        r.setY(r.getY() + getTextHeight());
        g.drawFittedText(str, r.toNearestInt(), juce::Justification::centred, 1);
    }
}
void RotarySliderWithLabels :: paint ( juce :: Graphics & g ) { using namespace juce ; auto startAng = degreesToRadians ( 180.f + 45.f ) ; auto endAng = degreesToRadians ( 180.f - 45.f ) + MathConstants < float > :: twoPi ; auto range = getRange ( ) ; auto sliderBounds = getSliderBounds ( ) ; g . setColour ( Colours :: red ) ; g . drawRect ( getLocalBounds ( ) ) ; g . setColour ( Colours :: yellow ) ; g . drawRect ( sliderBounds ) ; getLookAndFeel ( ) . drawRotarySlider ( g , sliderBounds . getX ( ) , sliderBounds . getY ( ) , sliderBounds . getWidth ( ) , sliderBounds . getHeight ( ) , jmap ( getValue ( ) , range . getStart ( ) , range . getEnd ( ) , 0.0 , 1.0 ) , startAng , endAng , * this ) ; auto center = sliderBounds . toFloat ( ) . getCentre ( ) ; auto radius = sliderBounds . getWidth ( ) * 0.5f ; g . setColour ( Colour ( 0u , 172u , 1u ) ) ; g . setFont ( getTextHeight ( ) ) ; auto numChoices = labels . size ( ) ; for ( int i = 0 ; i < numChoices ; ++ i ) { auto pos = labels [ i ] . pos ; jassert ( 0.f <= pos ) ; jassert ( pos <= 1.f ) ; auto ang = jmap ( pos , 0.f , 1.f , startAng , endAng ) ; auto c = center . getPointOnCircumference ( radius + getTextHeight ( ) * 0.5f + 1 , ang ) ; Rectangle < float > r ; auto str = labels [ i ] . label ; r . setSize ( g . getCurrentFont ( ) . getStringWidth ( str ) , getTextHeight ( ) ) ; r . setCentre ( c ) ; r . setY ( r . getY ( ) + getTextHeight ( ) ) ; g . drawFittedText ( str , r . toNearestInt ( ) , juce :: Justification :: centred , 1 ) ; } }
This function is to draw the sliders created
This function is to draw the sliders created
///starting angle of the rotary slider
 ///end angle of the rotary slider
 //This is to display the bounding boxes
 // turns slider value to normalize value.
 ///Creates the min and max number labels
 ///set the color of the min and max values
 ///positions the labels
 ///rectangle bound for the labels
