Slider mouse wheel and UndoManager

Hi all,

I’m getting into the last few things that are bugging me on a project. One that I can’t work out how to proceed on is my Sliders…

When they are adjusted using the mouse wheel, a ton of transactions are created. While it appears to be one change on the users end, it is technically many, and this clogs up the UndoManager. What is thought to be one change on a Slider using the mouse wheel can take many clicks of ‘Undo’ to revert.

Is there a simple way to resolve this? Any insight is appreciated.

Thanks in advance.

We have our own “undo manager” in one of our plugins, and the solution I thought of to handle that would be to include type, control/parameter ID and time information when adding things to our undo stack, then intercept the point at which an item is added to the stack, and at that point we can check if the item on the top of the stack and the item being added are both the same slider/knob event, and the time between them is “close” (say, less than a second), and if so, then updating the data on that top stack item instead of adding a new item.

Sorry if that’s no help, but that’s kind of the nature of using a mouse wheel to modify knobs/sliders… there are no mouse down/up gestures available to isolate the changes and group them all together as one change that can be undone. :frowning:

Thanks, that does help. I was thinking of doing something manual like that, but before I put too much time towards it I thought I’d ask just in case the functionality was already hidden somewhere in JUCE.