#ifndef TESTHOST_VST2RAWCHUNK_H_INCLUDED #define TESTHOST_VST2RAWCHUNK_H_INCLUDED #include /** Deliberately VST2-specific (unlike everything else in this tool): talks to the raw AEffect dispatcher directly, bypassing JUCE's own VSTPluginInstance::usesChunks() gate. Why this exists: JUCE's generic AudioProcessor::getStateInformation()/ setStateInformation() only reach a VST2 plugin's real effGetChunk/ effSetChunk implementation if the plugin's AEffect.flags advertises effFlagsProgramChunks. JaySynth's compiled JUCE 3.1.1 VST wrapper never sets that flag (see tools/testhost/TODO.md's Investigate section), so the generic path silently falls back to JUCE's own per-parameter "regular" fxb/fxp format instead - which never touches JaySynth's own bankEncodeXml/bankDecodeXml or patchEncodeXml/patchDecodeXml at all. Many real-world VST2 hosts don't strictly gate on that flag either - they just call effGetChunk/effSetChunk and see what comes back. This does the same thing on purpose, to reach and test that actual code path. */ namespace Vst2RawChunk { /** Returns nullptr if instance isn't hosted via VSTPluginFormat (or the AEffect's magic number doesn't check out). */ void *getRawAEffect (AudioPluginInstance *instance); /** isPreset: true = patch (single program) chunk, false = bank (whole plugin) chunk - matches VST2's effGetChunk/effSetChunk "index" argument (see aeffect.h). Returns false if the plugin isn't VST2, or the dispatcher call returned no data. */ bool getChunk (AudioPluginInstance *instance, bool isPreset, MemoryBlock &outData); bool setChunk (AudioPluginInstance *instance, bool isPreset, const void *data, int size); } #endif // TESTHOST_VST2RAWCHUNK_H_INCLUDED