examples/GainPlugin/PluginProcessor.cpp
AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
{
    AudioProcessorValueTreeState::ParameterLayout params (
        std::make_unique<AudioParameterFloat>(
            "MainGain",
            "Gain",
            NormalisableRange<float>(0.0, 1.0),
            0.8,
            String(),
            AudioProcessorParameter::genericParameter,
            [](float value, int /* maxLength */) {
                return String(Decibels::gainToDecibels(value), 1) + "dB";
            },
            nullptr
        ),
        std::make_unique<AudioParameterBool>(
            "MainMute",
            "Mute",
            false
       )
    );

    return params;
}
//==============================================================================
/** Helper function for generating the parameter layout. */
Helper function for generating the parameter layout.
Helper function for generating the parameter layout .
AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
{
    AudioProcessorValueTreeState::ParameterLayout params (
        std::make_unique<AudioParameterFloat>(
            "MainGain",
            "Gain",
            NormalisableRange<float>(0.0, 1.0),
            0.8,
            String(),
            AudioProcessorParameter::genericParameter,
            [](float value, int ) {
                return String(Decibels::gainToDecibels(value), 1) + "dB";
            },
            nullptr
        ),
        std::make_unique<AudioParameterBool>(
            "MainMute",
            "Mute",
            false
       )
    );
    return params;
}
AudioProcessorValueTreeState :: ParameterLayout createParameterLayout ( ) { AudioProcessorValueTreeState :: ParameterLayout params ( std :: make_unique < AudioParameterFloat > ( " " , " " , NormalisableRange < float > ( 0.0 , 1.0 ) , 0.8 , String ( ) , AudioProcessorParameter :: genericParameter , [ ] ( float value , int ) { return String ( Decibels :: gainToDecibels ( value ) , 1 ) + " " ; } , nullptr ) , std :: make_unique < AudioParameterBool > ( " " , " " , false ) ) ; return params ; }
Helper function for generating the parameter layout.
Helper function for generating the parameter layout .
/* maxLength */