Source/PluginEditor.cpp
//this is the implementation of the Stings created so they appear in the GUI

this is the implementation of the Stings created so they appear in the GUI
this is the implementation of the Stings created so they appear in the GUI
juce::String RotarySliderWithLabels::getDisplayString() const
{
    if( auto* choiceParam = dynamic_cast<juce::AudioParameterChoice*>(param) )
        return choiceParam->getCurrentChoiceName();
    juce::String str;
    bool addK = false;
    if( auto* floatParam = dynamic_cast<juce::AudioParameterFloat*>(param) )
    {
        float val = getValue();
        if( val > 999.f )
        {
            val /= 1000.f; 
            addK = true;
        }
        str = juce::String(val, (addK ? 2 : 0));
    }
    else
    {
        jassertfalse; 
    }
    if( suffix.isNotEmpty() )
    {
        str << " ";
        if( addK )
            str << "k";
        str << suffix;
    }
    return str;
}
juce :: String RotarySliderWithLabels :: getDisplayString ( ) const { if ( auto * choiceParam = dynamic_cast < juce :: AudioParameterChoice * > ( param ) ) return choiceParam -> getCurrentChoiceName ( ) ; juce :: String str ; bool addK = false ; if ( auto * floatParam = dynamic_cast < juce :: AudioParameterFloat * > ( param ) ) { float val = getValue ( ) ; if ( val > 999.f ) { val /= 1000.f ; addK = true ; } str = juce :: String ( val , ( addK ? 2 : 0 ) ) ; } else { jassertfalse ; } if ( suffix . isNotEmpty ( ) ) { str << " " ; if ( addK ) str << " " ; str << suffix ; } return str ; }
this is the implementation of the Stings created so they appear in the GUI
this is the implementation of the Stings created so they appear in the GUI
///to display accurate numbers for the low/high parameters
 ///checks if the value is over 1000 so it can change to kilohertz instead of hertz.
 //1001 / 1000 = 1.001
 //this shouldn't happen!
