Browse Source

Partially reverted fix for new VST3 SDK 3.6.7 by removing any dependency to VST2 SDK

tags/2021-05-28
hogliux 8 years ago
parent
commit
75cd666a61
4 changed files with 39 additions and 24 deletions
  1. +1
    -4
      extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp
  2. +3
    -3
      extras/Projucer/Source/Utility/jucer_StoredSettings.cpp
  3. +19
    -17
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  4. +16
    -0
      modules/juce_audio_processors/format_types/juce_VSTInterface.h

+ 1
- 4
extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp View File

@@ -329,10 +329,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()


+ 3
- 3
extras/Projucer/Source/Utility/jucer_StoredSettings.cpp View File

@@ -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)
{


+ 19
- 17
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -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 <pluginterfaces/vst2.x/vstfxstore.h>
#if JUCE_MSVC
#pragma warning (pop)
#endif
@@ -1265,19 +1267,19 @@ public:
void loadVST2VstWBlock (const char* data, int size)
{
const int headerLen = static_cast<int> (htonl (*(juce::int32*) (data + 4)));
const struct fxBank* bank = (const struct fxBank*) (data + (8 + headerLen));
const int version = static_cast<int> (htonl (bank->version)); ignoreUnused (version);
const vst2FxBank* bank = (const vst2FxBank*) (data + (8 + headerLen));
const int version = static_cast<int> (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)
@@ -1450,16 +1452,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);


+ 16
- 0
modules/juce_audio_processors/format_types/juce_VSTInterface.h View File

@@ -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


Loading…
Cancel
Save