adanlbenito Yes, there is you can check slider.hasChanged() == true before calling getSliderValue() to see if the value has changed with respect to the last stored value.
Ah! I had missed that you can call guiController.getSlider(idx) to get the actual slider object. That's great. I've actually already written a wrapper storing the current values an comparing them but this will make it much cleaner. Thanks!
I have implemented a function in my wrapper class which takes a callback to be executed on parameter change:
guiWrapper.addSliderWithCallback("OP1 Ratio", 1, 0.5, 10.0, 0.1, [](float value){
op1.setRatio(value);
});
Then in the top of the render function i call guiWrapper.update()
to check all params and execute the callbacks if needed. It seems to work as intended.
As you suggest, I will also add a function guiWrapper.updateSmoothing()
(or something like that) that will be called on each frame. Using The OnePole
for the actual smoothing was a good suggestion, thanks for that!