I have a plugin with a number of Component views, and a couple of Button objects that are set up to have attachments to parameters. When I am loading a saved session, while creating those Components and the Buttons’ attachments, the buttonClicked() function is called for those Buttons, which sends their state to my Editor. The Editor, when getting that state change information, sends it to another Component (a keyboard), which is supposed to apply that information in order to modify the keyboard’s behavior. However, the keyboard has not yet been created at that point, so my code does not attempt to call the keyboard’s function for setting that option.
What is the proper way to address interconnected Components that have parameter attachments? Is there a way to change the order of initialization of the Components, by re-arranging them in Projucer or something? Is that even the correct approach to this?
Or do I need to handle this manually via, say, a flag that says I have information that needs applying, and checking that flag in the timer callback to see if there is a new value for either of those switches to apply to the keyboard? That seems kind of hokey, but maybe a better design than relying on creation order?
Or, maybe the most robust method, removing the function to set that flag, and actually querying those parameters from a timer callback to see if the parameter values have changed and applying the behavior change from there?