I am trying to implement a proper preset mechanism in my plugin. Right now, if I include my preset code (i.e. implement getNumPrograms(), getCurrentProgram(), setCurrentProgram(int index), getProgramName (int index), and changeProgramName (int index, const String& newName)), every time I save a project in Live, the project will open up with the settings from the last preset chosen, instead of the actual plugin settings at the time.
I am not calling setCurrentProgram() from within my plugin code, so this is clearly the host calling this, presumably after setStateInformation() is called. If I remove all of my code for getNumPrograms() etc., and just use setStateInformation() and getStateInformation(), the plugin saves and recalls its state properly, so I know this is working (my code is essentially the same as the JuceDemoPlugin in this case, with the one difference being that I have an array of parameters rather than parameters I access by different names).
Any idea what I am doing wrong, or what I am missing? I just found out about getCurrentProgramStateInformation() and setCurrentProgramStateInformation(), but I am unclear on what these actually do.
Thanks for any help on this.