How to handle the wrapped-up final PF_Cmd_USER_CHANGED_PARAM event after dragging a slider
When dragging a slider, Premiere sends intermediate param change events. During that event, plugins can set other params to other values too. But once the user lets go of the mouse button, Premiere undoes all param changes again and sends a final wrap-up 'total' param change event. So if the user drags a slider from 50 to 30 we get intermediate values like 48, 43, ... 32, 30. But when he stops dragging, we get a final extra event where the value is 30 (again) and all other param changes we did in between are undone.
Why would Premiere do this kind of undo-and-double-event-sending in the first place? It just seems so illogical to do so... And it leads to unfixable unexpected param updates for plugin creators to deal with. Trying to do anything fancy with intermediate calculations (what I just tried to implement) is soon too complex to fit this model; the only way I see this working is by dumbing my interface down again and going for the lesser solution.
What can I do to mitigate this?
Example.
Say my plugin has two sliders; 'left' and 'right'. I also want to conditionally interlink the 'left' and 'right' sliders with a 'link left/right' checkbox. In the param change event I thus check if the checkbox is checked, and if so, the change to the active param is also added to the other one. (I have two hidden "previous value" sliders that I use to track deltas between update events.) So far so good.
These sliders also have a min and max value set on them, so if changes to one of them forces the other to go beyond it's limits, I clamp the other one to that limit. When the user (without letting go) then drags the slider back (in the same dragging session), the other one immediately moves along nicely from it's clamped position. This gives a very smooth and intuitive UX while dragging the sliders, so: so far so great! The user can drag back-and-forth smoothly while every intermediate step is logical.
And then Premiere messes it up when the user lets go of the mouse button. All intermediate param changes are undone, and the final 'total' event is sent. In some situations this works out to the same situation, but when the user has done a bit of back and forth with intermediate clamping and re-attaching of the other param, all this intermediate history is also gone, and that one final 'total' event has a totally different effect on the values. Which gives a very jarring 'snap back' effect for the user. Sad times...
Example, all in one slider drag session. Left is set to 10, right to 50; min and max of both is 0. Right is dragged down to 40, so left gradually moves to 0. Right is dragged further to 10; left stays clamped at 0. Right is dragged back to 30 again; left moves along to 20. The user now stops dragging. Premiere undoes all these changes, and sends a final "Right moved from 50 to 30" event. My code processes that and sets left to (clamped) 0; something *totally* different. Since these values also get visualized in the render, the users sees a violent snap-back reaction there as well.
😞
