[Fixed] ButtonAttachment UI->param does not work the first time


I’m on the tip of the develop branch.

When changing the value in the UI the first time, in AudioProcessorValueTreeState::ButtonAttachment::Pimpl::buttonClicked(…) the value change it is eaten by the initial value of ignoreCallbacks bool flag (the one that is set up by the initial call to Pimpl::setValue()).

Just my own opinion: in your implementation choice, the callbacks in all the Attachment classes are two-ways, hence these ugly flags and even Locks (!); these callbacks should have been one-way, and dontSendNotification should have taken care of preventing the change loops. I don’t understand how you have come up to such a convoluted implementation. Probably I haven’t tried to implement that myself (?) (I don’t want to be rude, you make an amazing job)



This is now fixed on develop.

Yes, the AudioProcessorValueTreeState code is complicated, but it is solving a difficult problem. Here almost all of the important methods can be called on different threads at any time and different types of parameter changes need to be broadcast in different ways as the underlying ValueTree is public (so users of this class can construct additional networks of listeners).