Previously I made some plugins and I liked the mechanism of AudioProcessorValueTreeState and SliderAttachment, that provide automatic communication between parameters and sliders and keep everything synchronized.
Now I’m making a desktop app (not a plugin). Is there any similar mechanism provided for desktop apps with no AudioProcessors?
AudioProcessorValueTreeState is pretty much just a wrapper around a
ValueTree that manages some plugin parameters. If you’re not using a plugin and so don’t have parameters, you can just use a
ValueTree on its own!
Sliders have a
Value object that can be referred to a particular property in a
ValueTree. Doing so will mean the value is updated in the tree when the slider moves, and the slider will be updated when the value in the tree changes. However, this method isn’t thread safe like
SliderAttachment is, so if you’re dealing with multiple threads you’ll need to handle that yourself.
It’s a perfect solution for my app and it helped my understanding how those classes work.