Hi Juce community !
I started to do a thing I've wanted to do for a long time: develop audio application. And I just found this fantastic & amazing library !
I read all the tutorials and a lot of topics of this forum but I'm still not able to fix my problem. It's all about design pattern.
I know a lot of programming language (objective-c for ios, c#, c, and so on...) but it's my first time with c++, so maybe my post could help some "newbies" in c++/Juce like me.
Here is my problem:
I want to play a sound and control some parameter with the help of slider. Like the "Audio level control" tutorial for exemple.
I used to use MVC pattern so I can't help to have different files. From what I understood Juce is not really made for a MVC pattern, but we can make a Model / View pattern. And here comes my issues.
Let's say I have MyAudiProcessor (.cpp/.h) where all the audio things are done especially the famous void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) .
Then I have MainComponent (.cpp/.h) where all the GUI things go (sliders, buttons, label, ...).
And I want to control the audio volume from the components values (it's exactly the same thing that we can see in the tutorial but instead using one file want to use 2 (or 4 with the .h)
My issues would be:
1°) What is the best way to interact between the classes ? What I have to do for having the value of the slider in the getNextAudioBlock method?
I thought to declare an instance of each class in each other. But how to handle the changes events?
Or maybe I have to work with listeners/change ?
Or an other thing I saw was Value and ValueTree ? But I'm not sure it's the best thing to use here (and I don't really understand what are these 2 things...)
I'm totally lost...
2°) What do you think about this design pattern which separate the GUI and from the rest ? Is it good or do you use a better pattern for Juce applications?
Thanking you in advance for your help.