Saving plugin internal state

More or less yes.
eg-sampler from LV2 also has a working example of this, robin/x42 example plugins were missing a few tiny bits last time I checked.

the steps are typically:

  1. define a lv2:Parameter of a known type (bool, int, long, float, double, string, path or vector)
  2. mark such parameter as readable (host can see it and let it pass through UI<->DSP but not change it) or writable (will be shown as editable widget under plugin settings on MOD)
  3. have an atom input and output port, where you listen to changes made to the parameter (via input) and also report them back to the host (via output)
  4. save and reload such parameter info during the state save&restore calls (note: when restoring state, make sure to notify host later, via worker or some internal flag, that this state has changed)
2 Likes