Now that APVTS is getting some attention, could someone please add the following utilities. I’ve been patching my JUCE code for over a year with this and it would be great to actually have it in the code base. I’m sure someone else would find it useful.
void AudioProcessorValueTreeState::setParameterRange(juce::StringRef paramID, NormalisableRange<float>newRange)
{
// my old code use to do this...
if (Parameter* p = Parameter::getParameterForID (processor, paramID))
p->range = newRange;
}
This is useful because I have several parameters that need to change their step values depending on user configuration. Frankly, I’d be happy with just a way to change the step value.
And…please make this public instead of private:
bool flushParameterValuesToValueTree();
The reason I’d like it public: To maintain compatibility with an older version, I need to update parameters in a specific order (because of meta-parameters) rather than just replacing the entire state, and to do that, I need to call flushParameterValuesToValueTree()
after updating all the parameters.
Thank you.