Setting isMeta using the new parameter stuff


#1

Hi, I’m doing this

	pluginParams.createAndAddParameter(std::make_unique<AudioParameterFloat>("mainRange", "Pitch Range", ran10, ran10.snapToLegalValue(3.0f)));

But that’s not the issue, It’s parameter listener is checking to see if another parameter is in said range, if not then set it so it is in range.
Unfortunately this causes an error in ‘auval’ which states
“Parameter valus are different from last set - probable cause: a Meta Param flag is NOT set…”

How do I set the isMetaParameter flag properly in my parameter definition?
Thanks,
Dave


#2

I don’t think you can.

AudioParameterInt, AudioParameterBool, etc. are pretty limited.
I find it a bit confusing and it would probably be better if those classes where not there at all.

You should either make your own parameter classes inheriting RangedAudioParameter, or use AudioProcessorValueTreeState::Parameter (which inherits AudioParameterFloat and have a few extra flags for the meta/automatable states)

note that AudioProcessorValueTreeState::Parameter exists to maintain backwards compatibility with deprecated AudioProcessorValueTreeState functionality but it is not said if that class might also be deprecated one day…


#3

Thanks, I started to use ‘Parameter’ but forgot to add the AudioProcessorValueTreeState to the beginning, like a flaming noob! It seems like AudioParameterFloat is there for our convenience, but it really just slightly over complicates things.