I’m new to the idea of managing threads and I found that I get errors when I update my components using the value tree parameter listener. So should I use SliderListener for updating/repainting components(UI thread) and value tree listener for updates in the audio thread? Or is there a better way to do that?
Btw the slider and the parameters are attached using sliderAttachments, the reason I can’t just do a param.get() to update my components is because I don’t want to keep repainting, I need to use a listener to repaint only when a param/slider is changed.
Update: Sorry I wasn’t really clear in my post originally, but I’m actually trying to repaint a custom component to display my wavetable. I understand how the attachments work, I just need a way to repaint my wavetableDisplay component only when a slider value is changed. I originally tried inheriting the ValueTree listener class on my wavetableDisplay component, but it gives errors sometimes since I’m accessing the the audiothread from the UI thread. So I was wondering is there any other way to do this?
I just tried using Slider::Listener but the problem is the slider is part of the wavetableDisplay’s parent component, so I can’t call the slider’s addListener function inside wavetableDisplay.