I was wondering how to utilize the AudioParameterInt class.
AudioParameterInt intParam("testInt", "IntParam", 0, 200, 100); int val1 = intParam.get(); // Returns 100 intParam.setValueNotifyingHost(50); int val2 = intParam.get(); // Returns 200 intParam.setValueNotifyingHost(0.25f); int val3 = intParam.get(); // Returns 50
In this code the value returned after calling set() is 200 because set() is expecting to be called with a scaled float value not a value between the min:0 and max:200. I don’t see this class in any of the juce example code. Obviously I can just scale the values but I would like to know what I am missing.
Update: I get that it’s meant to be used by UI components that provide values between 0 and 1. But getValue is private so I can’t get the scaled value to update the UI. I was using this class for an internal AudioProcessor not a plugin.