AudioProcessorValueTreeState::Parameter modify steps?


#1

Is there no way to change the steps of an existing AudioProcessorValueTreeState::Parameter?

I want to give my users the choice of either continuous or stepped values for a specific parameter, but it looks like there’s no way to change the steps once it’s created. There’s a getNumSteps() method but no setNumSteps().

It would probably have to modify the range parameter of a slider attachment as well if it exists.


#2

I added this:

void AudioProcessorValueTreeState::setParameterRange(juce::StringRef paramID, NormalisableRange<float>newRange)
{
    if (Parameter* p = Parameter::getParameterForID (processor, paramID))
        p->range = newRange;
}

But I also need to modify the range of the SliderAttachment, which doesn’t look very accessible from the AudioProcessorValueTreeState. I guess I could do that separately in my editor, but it would be nice to make the change in one place. Anyone?


#3

Wouldn’t you also need to inform the host that the number of steps of the parameter has changed? Do hosts support this?


#4

I suppose so. That’s why I’m asking for this functionality to be added because I’m sure there are some things I’m missing.