I’m porting an old non-JUCE plugin to JUCE.
The old version of the plugin didn’t save a chunk - only communicated with the host using parameters and programs.
When I launch the JUCE VST2 version, I’m able to load a session saved with the old version of the plugin, and it loads correctly in all different hosts.
However, with AU (Logic/Ableton Live) it seems like I’m not getting any calls to update the plugin with the stored parameters.
I am getting a call to restoreState() - which fails due to the fact the old plugin saves a version number of “1” and MusicDeviceBase::RestoreState, which the JUCE wrapper calls to, only accepts hard coded “0” for the version.
Any ideas on what to do?
Did anyone port a non-JUCE AU plugin to JUCE and has any ideas?
Follow up: I managed to fix that problem by forking JUCE, which I’d rather avoid.
The old plugin was wrapped using Symbiosis, which creates a special chunk for the AU plugin that isn’t passed to the setStateInformation() by the wrapper.
There are two things I had to change in order for this to work:
- in juce_au_wrapper.mm, the function restore state() does:
ComponentResult err = MusicDeviceBase::RestoreState (copyWithoutData);
if (err != noErr)
If an incompatible version number (1 in the case of Symbiosis-stored presets) was stored, this would return and not continue to load the preset in the plugin.
- in the follow up code:
CFStringRef key = CFStringCreateWithCString (kCFAllocatorDefault, JUCE_STATE_DICTIONARY_KEY, kCFStringEncodingUTF8);
bool valuePresent = CFDictionaryGetValueIfPresent (dict, key, (const void**) &data);
//passes chunk to plugin
The JUCE_STATE_DICTIONARY_KEY only accepts chunks stored as “jucePluginState”, where the old wrapper saved the data as “vstdata”.
It would be great if the user would be given the option to define the criteria to pass the preset chunk to the plugin, so the hard coded conditions would be a bit more flexible.
Is there a chance this could be added to JUCE?