Hi! Newb here.
I’m sorry for this non JUCE specific and more general C++/Software Design question, but I hope you don’t mind all to much…
I built my first Audio Application by following the tutorials and set up my
GuiComponent as member of my
AudioAppComponent. My Gui are a bunch of nested Components four levels deep, with Buttons and Labels as members of SubComponents, which are members of Header/Footer/SidebarComponents which are members of the
I have set up the Logic of the Gui (like showing different screens) with Listener- and State-Patterns. But for handling inputs and outputs I need a class (lets call it
Foo) that listens to Buttons and sets Labels far apart in my GuiTree.
When I make
Foo a member of
AudioAppComponent and it’s on the same level as
GuiComponent, I can only come up with the following solutions:
- make all Components public and make calls on them directly (although this is not the way the tutorials teach to do things)
- make back-pointers for cross connection between Components
- hand down variable references that
- save the state of the variables
Foois working on in a ValueTree and make the Components listen to that
I hope I described my problem clear enough and I’m sorry if this question is too basic. I just think there is some sort of design trick I haven’t heard about yet and that I am about to make things much to complex than they have to be…
Thanks for all that have read this far! I’m grateful for every answer!