setParameterNotifyingHost Question


  • I've built a ValueTree which stores my GUI state.  GUI objects which update parameters change a sub-tree containing the relevant information.
  • I've added a listener to the ValueTree. 
  • The listener calls processor.setParameterNotifyingHost(...)
  • That calls setParameter(...)
  • setParameter(...) makes a thread-safe call to update the audio thread. 

However setParameter(...) is also called by the host.  When the host calls it I need to update the GUI, and the ValueTree, which triggers this whole loop off again, notifying the host of the parameter change that it just made.  Is that necesssary?  I get a duplicate update call into setParameter as well. 

I'm thinking that the solution is to call sendParamChangeToListeners directly and then the thread-safe audio thread update call. 

Is that sensible?

Mmm, this whole things seems to have been played out before:

Though not with a picture: 

Thank you - I don't think I can easily use it but it's interesting to see what you've done.  Unfortunately i've got existing users with an existing format for the plugins. And I'm building the whole plugin from an XML/ValueTree setup which would need work too.  

But it's good to see how you're doing it.