Source/PluginEditor.cpp
//this function initalize the labels of the Response curve component

this function initalize the labels of the Response curve component
this function initalize the labels of the Response curve component
void ResponseCurveComponent::drawTextLabels(juce::Graphics &g)
{
    using namespace juce;
    g.setColour(Colours::yellow); 
    const int fontHeight = 10;
    g.setFont(fontHeight);
    auto renderArea = getAnalysisArea();
    auto left = renderArea.getX();
    auto top = renderArea.getY();
    auto bottom = renderArea.getBottom();
    auto width = renderArea.getWidth();
    auto freqs = getFrequencies();
    auto xs = getXs(freqs, left, width);
    for( int i = 0; i < freqs.size(); ++i )
    {
        auto f = freqs[i];
        auto x = xs[i];
        bool addK = false;
        String str;
        if( f > 999.f )
        {
            addK = true;
            f /= 1000.f;
        }
        str << f;
        if( addK )
            str << "k";
        str << "Hz";
        auto textWidth = g.getCurrentFont().getStringWidth(str);
        Rectangle<int> r;
        r.setSize(textWidth, fontHeight);
        r.setCentre(x, 0);
        r.setY(1);
        g.drawFittedText(str, r, juce::Justification::centred, 1);
    }
    auto gain = getGains(); 
    for( auto gDb : gain )
    {
        auto y = jmap(gDb, -24.f, 24.f, float(bottom), float(top));
        String str;
        if( gDb > 0 )
            str << "+";
        str << gDb;
        auto textWidth = g.getCurrentFont().getStringWidth(str);
        Rectangle<int> r;
        r.setSize(textWidth, fontHeight);
        r.setX(getWidth() - textWidth);
        r.setCentre(r.getCentreX(), y);
        g.setColour(gDb == 0.f ? Colour(0u, 172u, 1u) : Colours::lightgrey ); 
        g.drawFittedText(str, r, juce::Justification::centredLeft, 1);
        str.clear();
        str << (gDb - 24.f); 
        r.setX(1);
        textWidth = g.getCurrentFont().getStringWidth(str);
        r.setSize(textWidth, fontHeight);
        g.setColour(Colours::lightgrey);
        g.drawFittedText(str, r, juce::Justification::centredLeft, 1);
    }
}
void ResponseCurveComponent :: drawTextLabels ( juce :: Graphics & g ) { using namespace juce ; g . setColour ( Colours :: yellow ) ; const int fontHeight = 10 ; g . setFont ( fontHeight ) ; auto renderArea = getAnalysisArea ( ) ; auto left = renderArea . getX ( ) ; auto top = renderArea . getY ( ) ; auto bottom = renderArea . getBottom ( ) ; auto width = renderArea . getWidth ( ) ; auto freqs = getFrequencies ( ) ; auto xs = getXs ( freqs , left , width ) ; for ( int i = 0 ; i < freqs . size ( ) ; ++ i ) { auto f = freqs [ i ] ; auto x = xs [ i ] ; bool addK = false ; String str ; if ( f > 999.f ) { addK = true ; f /= 1000.f ; } str << f ; if ( addK ) str << " " ; str << " " ; auto textWidth = g . getCurrentFont ( ) . getStringWidth ( str ) ; Rectangle < int > r ; r . setSize ( textWidth , fontHeight ) ; r . setCentre ( x , 0 ) ; r . setY ( 1 ) ; g . drawFittedText ( str , r , juce :: Justification :: centred , 1 ) ; } auto gain = getGains ( ) ; for ( auto gDb : gain ) { auto y = jmap ( gDb , -24.f , 24.f , float ( bottom ) , float ( top ) ) ; String str ; if ( gDb > 0 ) str << " " ; str << gDb ; auto textWidth = g . getCurrentFont ( ) . getStringWidth ( str ) ; Rectangle < int > r ; r . setSize ( textWidth , fontHeight ) ; r . setX ( getWidth ( ) - textWidth ) ; r . setCentre ( r . getCentreX ( ) , y ) ; g . setColour ( gDb == 0.f ? Colour ( 0u , 172u , 1u ) : Colours :: lightgrey ) ; g . drawFittedText ( str , r , juce :: Justification :: centredLeft , 1 ) ; str . clear ( ) ; str << ( gDb - 24.f ) ; r . setX ( 1 ) ; textWidth = g . getCurrentFont ( ) . getStringWidth ( str ) ; r . setSize ( textWidth , fontHeight ) ; g . setColour ( Colours :: lightgrey ) ; g . drawFittedText ( str , r , juce :: Justification :: centredLeft , 1 ) ; } }
this function initalize the labels of the Response curve component
this function initalize the labels of the Response curve component
///this sets the color for the top frequencies.
 ///loops over the frequencies at x position to draw labels in their respective frequency
 ///this is to get the gain info
 ///loops over all the decibels
 ///this is to give the colors for the db lines
 ///this is to draw the left labels
