Bug with the new implementation of GenericAudioProcessorEditor class

Hello guys !

I have seen a bug with the way the new class GenericAudioProcessorEditor handles boolean parameters. When I use one, the UI displays two buttons with the text values specific to each state such as “OFF” and “ON”, using a class called “SwitchParameterComponent”.

However, when I click on the button “ON”, it is first selected properly, and then it is deselected and the button “OFF” becomes selected instead.

I think this happens because in that class, the AudioParameter is expected to be AudioParameterChoice instead of AudioParameterBoolean, and that the new normalised float value for that parameter is picked using getParameterFromText, which returns incorrect behaviour on this specific code since it should be AudioParameterChoice::getParameterFromText which should be called with such an implementation and not AudioParameterBool::getParameterFromText

If you use the AudioParameterBool class then you will get a checkbox, rather than a switch…

Could you provide some code?

Oh my, I didn’t see that function “isBoolean” which needs to be overriden by custom AudioParameter classes :slight_smile: Don’t mind it, the problem was in my code, thanks for helping :wink: