FR: Please add versionHint parameter to all AudioProcessorParameter subclasses

Please add versionHint parameter to all AudioProcessorParameter subclasses. Can’t use any of these classes now without an assert. Or at least a setter.

1 Like

The parameter types now take a ParameterID as their first constructor argument. The ParameterID can be constructed from a string (implicitly convertible for backwards compatibility), in which case the version hint defaults to zero. Alternatively, it can be constructed from a string and a version hint, i.e. ParameterID { "unique_id", 1 }.

Designing the new constructor signatures was a bit tricky because we didn’t want to force users to change working code. Sticking the version hint at the beginning of the constructor would have led to lots of duplicated constructor signatures and default parameter values, and sticking it at the end would have required users to explicitly specify lots of the default parameter values in their own code in order to add a version hint. The current solution allows user code to be updated easily, without adding too much duplication in JUCE code.

2 Likes

Ok, I see… I can still access the AudioProcessorParameter constructor even from subclasses that don’t have that constructor… thought I couldn’t do that for some reason.