Plugin state saving (initiated by user from host DAW)

Dear all,

I have a question about saving of plugin state. I know the getStateInformation (juce::MemoryBlock& destData) function is called when DAW (host) exits and/or user wants to save the project (for example in Reaper).

However, that function is also called if we for example call setParameterNotifyingHost or when changing some of the parameter sliders of the related audio processor.

So, do we have a way to know exactly when user wants to save DAW project?

Thank you very much for help.

The APIs make no guarantees about that. The only thing you can be certain is, that there will be always another host, that does it differently, for all possible reasons:

ProTools keeps the last state for it’s compare functionality
FinalCut saves continuously
Some call it cycling through each preset, so they can cache that information
…and so on…

2 Likes

Another thing to be wary of is getStateInformation can be called from a separate thread whilst your editor is being instantiated. I just spent far too much time trying to work out why a ValueTree in my editor was getting trashed when reloading a DAW session.

This applies to almost everything, the bane of a plugin developers life is host behaviour! :joy:

1 Like