Is buttonClicked() called by parameter changes?


#1

I’m confused by the operation of buttonClicked(). If I add a listener to a button, then override buttonClicked(), I would assume that buttonClicked() would only be called if the button is ‘physically’ clicked with a mouse (or other input device), but it seems as if it’s also called by parameter changes, such as those caused by program changes or automation. Is this what should be happening? I’m using AudioProcessorValueTreeState, if that’s relevant.


#2

Are you sure it’s actually the buttonClicked method being called by parameter changes? Sounds like it could just be that you’re using buttonClicked to change some parameters in the valuetree and then the host is also changing the parameters elsewhere.
Try adding a DBG () somewhere in the clicked method to see when exactly it’s being called.


#3

Yes, thank you lm_Jimmi, I’d accidentally created a loop by setting parameters manually elsewhere in my code. Sorted now.