New plugin automation examples

Hi everyone. Continuing my quest to create realistic sample code for basic plugin technologies, I have just put two new parameter automation demo projects onto GitHub. The first one is based on the older AudioParameter classes; the second uses AudioProcessorValueTreeState.

In the second project, I ran into problems trying to use an UndoManager: Undo works (a bit sporadically), but redo does not work at all. I’d appreciate any feedback about what I might be doing wrong (with respect to undo/redo or any other aspect of the code).

Thanks in advance and best wishes to all.

With UndoManager it’s all about calling beginNewTransaction at the right times. What I tend to do in my apps is to have a timer that calls it occasionally if there’s been no user input for e.g. a couple of seconds.

Redo never worked correctly with AudioProcessorValueTreeState, it’s a known bug :

Update: In my tiny-but-complete Juce synthesizer plugin example VanillaJuce, I have added a branch using the first approach to add automation support. I intend to add another branch using AudioProcessorValueTreeState, if I can get it working.

What is the recommended method to determine “if there’s been no user input”? With the first approach I could add setTimer() calls to all my GUI-control listeners, but when using the new Attachment classes, I’d have to subclass them all to hook into the callbacks. Is there a better way?

1 Like