I have a sampler which loads different samplebanks as wanted by the user. The issue is that I’d like it to load up the default one when the plugin is first time added to the project. But, when the project is saved, and re-opened, I don’t want the plugin to load the default package but the user chosen one. I do have user-chosen package loading in “setStateInformation” method, which enables to load up the custom package when the project is re-opened. That’s ok. But the issue is, when loading up the default one, if it happens in the constructor of my AudioProcessor, it happens even during re-opening of the project.
I placed the default loading method in my getStateInformation for now, and I could work with that, but it’s uncertain to me, does the getStateInformation happen for any DAW by default when adding a new plugin instance to the project. It seems to do so in Reaper and Logic. Obviously getStateInformation happens possibly many times in second however the DAW chooses to do so, and I’ve got checks for that not to load the package each time… But I bet it’s not the bast place.
Do you have knowledge on does getStateInformation happen each time plugin instance is added, and does it happen even when re-opening a project, before, or after setStateInformation…???
Or even better, do you got any ideas how to make this not so quirky… hah.