diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp index c64f0595dd..d8da4a1f9e 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp @@ -308,10 +308,7 @@ void ProjectExporter::addVST3FolderToPath() const String vst3Folder (getVST3PathValue().toString()); if (vst3Folder.isNotEmpty()) - { - addToExtraSearchPaths (RelativePath (vst3Folder, RelativePath::projectFolder).getChildFile ("VST2_SDK"), 0); - addToExtraSearchPaths (RelativePath (vst3Folder, RelativePath::projectFolder).getChildFile ("VST3_SDK"), 0); - } + addToExtraSearchPaths (RelativePath (vst3Folder, RelativePath::projectFolder), 0); } void ProjectExporter::addAAXFoldersToPath() diff --git a/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp b/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp index 0900231afc..34dce0cbed 100644 --- a/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp +++ b/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp @@ -237,8 +237,8 @@ Value StoredSettings::getGlobalPath (const Identifier& key, DependencyPathOS os) String StoredSettings::getFallbackPath (const Identifier& key, DependencyPathOS os) { if (key == Ids::vst3Path) - return os == TargetOS::windows ? "c:\\SDKs\\VST3 SDK" - : "~/SDKs/VST3 SDK"; + return os == TargetOS::windows ? "c:\\SDKs\\VST_SDK\\VST3_SDK" + : "~/SDKs/VST_SDK/VST3_SDK"; if (key == Ids::rtasPath) { @@ -277,7 +277,7 @@ bool StoredSettings::isGlobalPathValid (const File& relativeTo, const Identifier if (key == Ids::vst3Path) { - fileToCheckFor = "VST3_SDK/base/source/baseiids.cpp"; + fileToCheckFor = "base/source/baseiids.cpp"; } else if (key == Ids::rtasPath) { diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 09f44b2edd..a3f964f377 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -55,6 +55,10 @@ #define JUCE_VST3_CAN_REPLACE_VST2 1 #endif +#if JUCE_VST3_CAN_REPLACE_VST2 +#include "../../juce_audio_processors/format_types/juce_VSTInterface.h" +#endif + #ifndef JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS #define JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS 1 #endif @@ -65,8 +69,6 @@ #pragma warning (disable: 4514 4996) #endif - #include - #if JUCE_MSVC #pragma warning (pop) #endif @@ -1276,19 +1278,19 @@ public: void loadVST2VstWBlock (const char* data, int size) { const int headerLen = static_cast (htonl (*(juce::int32*) (data + 4))); - const struct fxBank* bank = (const struct fxBank*) (data + (8 + headerLen)); - const int version = static_cast (htonl (bank->version)); ignoreUnused (version); + const vst2FxBank* bank = (const vst2FxBank*) (data + (8 + headerLen)); + const int version = static_cast (htonl (bank->version1)); ignoreUnused (version); jassert ('VstW' == htonl (*(juce::int32*) data)); jassert (1 == htonl (*(juce::int32*) (data + 8))); // version should be 1 according to Steinberg's docs - jassert (cMagic == htonl (bank->chunkMagic)); - jassert (chunkBankMagic == htonl (bank->fxMagic)); + jassert ('CcnK' == htonl (bank->magic1)); + jassert ('FBCh' == htonl (bank->magic2)); jassert (version == 1 || version == 2); jassert (JucePlugin_VSTUniqueID == htonl (bank->fxID)); - setStateInformation (bank->content.data.chunk, - jmin ((int) (size - (bank->content.data.chunk - data)), - (int) htonl (bank->content.data.size))); + setStateInformation (bank->chunk, + jmin ((int) (size - (bank->chunk - data)), + (int) htonl (bank->chunkSize))); } bool loadVST3PresetFile (const char* data, int size) @@ -1477,16 +1479,16 @@ public: return status; const int bankBlockSize = 160; - struct fxBank bank; + vst2FxBank bank; zerostruct (bank); - bank.chunkMagic = (VstInt32) htonl (cMagic); - bank.byteSize = (VstInt32) htonl (bankBlockSize - 8 + (unsigned int) mem.getSize()); - bank.fxMagic = (VstInt32) htonl (chunkBankMagic); - bank.version = (VstInt32) htonl (2); - bank.fxID = (VstInt32) htonl (JucePlugin_VSTUniqueID); - bank.fxVersion = (VstInt32) htonl (JucePlugin_VersionCode); - bank.content.data.size = (VstInt32) htonl ((unsigned int) mem.getSize()); + bank.magic1 = (int32) htonl ('CcnK'); + bank.size = (int32) htonl (bankBlockSize - 8 + (unsigned int) mem.getSize()); + bank.magic1 = (int32) htonl ('FBCh'); + bank.version1 = (int32) htonl (2); + bank.fxID = (int32) htonl (JucePlugin_VSTUniqueID); + bank.version2 = (int32) htonl (JucePlugin_VersionCode); + bank.chunkSize = (int32) htonl ((unsigned int) mem.getSize()); status = state->write (&bank, bankBlockSize); diff --git a/modules/juce_audio_processors/format_types/juce_VSTInterface.h b/modules/juce_audio_processors/format_types/juce_VSTInterface.h index fc1010533b..8d6c664719 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTInterface.h +++ b/modules/juce_audio_processors/format_types/juce_VSTInterface.h @@ -447,6 +447,22 @@ enum VstSpeakerConfigurationType vstSpeakerConfigTypeLRCLfeLsRsTflTfcTfrTrlTrrLfe2 }; +//============================================================================== +struct vst2FxBank +{ + int32 magic1; + int32 size; + int32 magic2; + int32 version1; + int32 fxID; + int32 version2; + int32 elements; + int32 current; + char shouldBeZero[124]; + int32 chunkSize; + char chunk[1]; +}; + #if JUCE_MSVC #pragma pack(pop) #elif JUCE_MAC || JUCE_IOS