How does JUCE implement undo/redo for VST3 - FL Studio?

As undo/redo is not part of the VST3 spec, how does JUCE realize/integrate undo/redo functionality for FL Studio? Pointing out FL Studio here, as some DAWs like Live of Reaper support undo/redo for any VST3, without the plugin having to add additional logic for that.

I would assume Live and Reaper simply keep track of the parameter changes, and use their own undo stack to reset parameters to their previous values when using their Undo function, just by setting the parameters the same way they’d do automation during playback.

Turns out Live and Reaper already enable undo/redo when the plugin only sends value changes. Other DAWs like FL Studio or Studio One rely on changes being wrapped in beginEdit and endEdit: Regarding undo stacks, each DAW manages the undo stack on their end, not the plugin.

If you have any non-parameter data in your state, you can notify the host about that as well. In a well behaved host, Undo/Redo will then work for stuff that’s not an automatable parameter too. Think of DAW-features like a/b compare, the “unsaved changes” asterisk, Cubase offline-processing auto apply, etc.
Use updateHostDisplay( ChangeDetails().withNonParameterStateChanged( true ) );

1 Like

Thanks for pointing that out @jcomusic !