Toggle Radio Buttons based on XML?


#1

So I have every slider and a bypass button loading my previous session info just fine.

My problem is I have these 4 buttons that are like radio buttons. Only one can be toggled. However, because of automation parameters they can basically all be turned on together, which doesn’t make any sense in the context of the plugin.

My idea was to have one single tree state parameter that toggled the buttons and 4 button attachments that attached to that tree state parameter.

My logic is
if this parameter is <1, set button 1 to toggled and untoggle the rest…
if this parameter is <2, set button 2 to toggled and untoggle the rest…
Same for buttons 3 and 4.

So…

How do I get the value of the parameter to compare with a float?

I’ve tried getParameter, getRawParameterValue, but I’m not doing it right apparently.

Basically when I toggle a button on, the parameter will stay at 1.0f, but when it’s toggled off the parameter doesn’t change back.


#2

You can access the underlying ValueTree of the AudioProcessorValueTreeState via its state member so you could add your own property to it to represent which radio group button is toggled.

Also, it’s best practice to limit your posts to one per topic - we try to answer every post so creating more for the same topic just adds unnecessary noise to the forum.