HI. I apology in advanced for my lack of knowledge or if this has been discussed before!
I have a simple plug-in with one parameter and a slider.
I initialize the slider on startup with parameter->get() and when a slider changed i set the parameter inside ‘sliderValueChanged (Slider* s)’. So far so good.
But the only problem is when the parameter is being automated by the host. I had to somehow update the slider to show the changes that’s being made.
My first attempt was to use AudioProcessorListener Class and use it when the parameter is not being changed by dragging the slider directly.
Results from ‘audioProcessorParameterChanged’ was unsuccessful because apparently it didn’t updated continuously. It only worked when i moved play position.
So i decided to add a timer in my AudioProcessor, and combine it with AudioProcessorListener which told me when something was happening. I also had to add a timer in ProcessorEditor to check if the update flag is up and so update the slider.
Things seemed to be working while automating (FL Studio), except when i moved the seek bar (song position) the parameter and slider kept resetting to a certain value, and ignoring the value i was dragging to (I think this was happening without any automation).
I’m not sure when i use ‘Slider->setValue()’ in the timercallback, if ‘sliderValueChanged (Slider* s)’ is getting called… and creating a loop.
I use a flag, when ‘sliderDragStarted’ i set it to true, and false with ‘sliderDragEnded’. This way with ‘audioProcessorParameterChanged’ i know if the parameter change is coming from slider or not, and so i wont update the slider inside timercallback.
Anyways i haven’t solved it yet. It seemed a lot of work to handle this. I know there are some advanced ways to connect and communicate between processor and editor objects, but my C++ is not that good yet.
Isn’t there a way to tell if the host is changing a parameter or automating or something like that?
Do we have to use a timer to catch these changes and update the UI and recalculate stuff?
How do you deal with this?