VST: setStateInformation() is not called after updated to JUCE 4


#1

Hi, after my VST plugin is updated to JUCE 4 (VST SDK is also updated), when opening projects saved from previous versions, all parameters are lost. I debug it and find setStateInformation() is not called at all. Does anyone have a clue? Save & Load with same version works fine.


#2

Which host?


#3

Tested on Cubase and Studio One, both failed.


#4

Clearly the hosts don’t think it’s the same plugin. Maybe a name or ID or version descriptor has changed.


#5

Yes. But the weird thing is that when the older version loads a project saved from newer version, all parameters are there.


Problems with setStateInformation not being called
#6

You probably need to set JUCE_VST_RETURN_HEX_VERSION_NUMBER_DIRECTLY=1 in the user part of your AppConfig.h. Without that, the newer JUCE will produce a version number of, e.g., 0.1.2.0 instead of 1.2.0.0 for Cubase and some other hosts, which will make Cubase think that version 1.1.0.0 is newer than version 1.2.0.0 (and therefore it won’t load the settings saved with the “older” version).


#7

Yes! It works!