I’ve made myself a little pretend AudioParameterFloat to run some tests on another class:
class TestParam : public AudioParameterFloat
{
public:
TestParam(
const ParameterID& parameterID,
const String& parameterName,
int parameterIndex,
NormalisableRange<float> normalisableRange,
float defaultValue,
const AudioParameterFloatAttributes& attributes = {}
) :
AudioParameterFloat(
parameterID,
parameterName,
normalisableRange,
defaultValue,
attributes
),
newParamIndex(parameterIndex)
{
}
virtual int getParameterIndex() const noexcept override { return newParamIndex; }
int newParamIndex;
};
The class I want to test will call getParameterIndex()
and I’d like it to receive the index I set in the constructor (newParamIndex
). Currently, that’s only working by making AudioProcessorParameter::getParameterIndex() virtual - does anyone have a better way of doing this sort of thing?