| @@ -34,7 +34,6 @@ PathSettingsTab::PathSettingsTab (DependencyPathOS os) | |||||
| StoredSettings& settings = getAppSettings(); | StoredSettings& settings = getAppSettings(); | ||||
| vst2PathComponent = pathComponents.add (new TextPropertyComponent (settings.getGlobalPath (Ids::vst2Path, os), "VST SDK", maxChars, false)); | |||||
| vst3PathComponent = pathComponents.add (new TextPropertyComponent (settings.getGlobalPath (Ids::vst3Path, os), "VST3 SDK", maxChars, false)); | vst3PathComponent = pathComponents.add (new TextPropertyComponent (settings.getGlobalPath (Ids::vst3Path, os), "VST3 SDK", maxChars, false)); | ||||
| #if ! JUCE_LINUX | #if ! JUCE_LINUX | ||||
| @@ -70,7 +69,6 @@ void PathSettingsTab::textPropertyComponentChanged (TextPropertyComponent* textP | |||||
| Identifier PathSettingsTab::getKeyForPropertyComponent (TextPropertyComponent* component) const | Identifier PathSettingsTab::getKeyForPropertyComponent (TextPropertyComponent* component) const | ||||
| { | { | ||||
| if (component == vst2PathComponent) return Ids::vst2Path; | |||||
| if (component == vst3PathComponent) return Ids::vst3Path; | if (component == vst3PathComponent) return Ids::vst3Path; | ||||
| if (component == rtasPathComponent) return Ids::rtasPath; | if (component == rtasPathComponent) return Ids::rtasPath; | ||||
| if (component == aaxPathComponent) return Ids::aaxPath; | if (component == aaxPathComponent) return Ids::aaxPath; | ||||
| @@ -64,7 +64,6 @@ private: | |||||
| OwnedArray<TextPropertyComponent> pathComponents; | OwnedArray<TextPropertyComponent> pathComponents; | ||||
| TextPropertyComponent* vst2PathComponent; | |||||
| TextPropertyComponent* vst3PathComponent; | TextPropertyComponent* vst3PathComponent; | ||||
| TextPropertyComponent* rtasPathComponent; | TextPropertyComponent* rtasPathComponent; | ||||
| TextPropertyComponent* aaxPathComponent; | TextPropertyComponent* aaxPathComponent; | ||||
| @@ -481,7 +481,6 @@ private: | |||||
| if (project.getProjectType().isAudioPlugin()) | if (project.getProjectType().isAudioPlugin()) | ||||
| { | { | ||||
| paths.add (getAppSettings().getGlobalPath (Ids::vst2Path, TargetOS::getThisOS()).toString()); | |||||
| paths.add (getAppSettings().getGlobalPath (Ids::vst3Path, TargetOS::getThisOS()).toString()); | paths.add (getAppSettings().getGlobalPath (Ids::vst3Path, TargetOS::getThisOS()).toString()); | ||||
| } | } | ||||
| @@ -433,7 +433,6 @@ private: | |||||
| DependencyPathOS pathOS = isLinux() ? TargetOS::linux | DependencyPathOS pathOS = isLinux() ? TargetOS::linux | ||||
| : TargetOS::windows; | : TargetOS::windows; | ||||
| vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder), Ids::vst2Path, pathOS))); | |||||
| vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, pathOS))); | vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, pathOS))); | ||||
| if (! isLinux()) | if (! isLinux()) | ||||
| @@ -749,10 +749,6 @@ protected: | |||||
| void initialiseDependencyPathValues() | void initialiseDependencyPathValues() | ||||
| { | { | ||||
| vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder), | |||||
| Ids::vst2Path, | |||||
| TargetOS::windows))); | |||||
| vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), | vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), | ||||
| Ids::vst3Path, | Ids::vst3Path, | ||||
| TargetOS::windows))); | TargetOS::windows))); | ||||
| @@ -473,10 +473,6 @@ private: | |||||
| void initialiseDependencyPathValues() | void initialiseDependencyPathValues() | ||||
| { | { | ||||
| vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder), | |||||
| Ids::vst2Path, | |||||
| TargetOS::linux))); | |||||
| vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), | vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), | ||||
| Ids::vst3Path, | Ids::vst3Path, | ||||
| TargetOS::linux))); | TargetOS::linux))); | ||||
| @@ -2706,7 +2706,6 @@ private: | |||||
| void initialiseDependencyPathValues() | void initialiseDependencyPathValues() | ||||
| { | { | ||||
| vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder), Ids::vst2Path, TargetOS::osx))); | |||||
| vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, TargetOS::osx))); | vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, TargetOS::osx))); | ||||
| aaxPath. referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, TargetOS::osx))); | aaxPath. referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, TargetOS::osx))); | ||||
| rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, TargetOS::osx))); | rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, TargetOS::osx))); | ||||
| @@ -242,15 +242,9 @@ void ProjectExporter::createPropertyEditors (PropertyListBuilder& props) | |||||
| void ProjectExporter::createDependencyPathProperties (PropertyListBuilder& props) | void ProjectExporter::createDependencyPathProperties (PropertyListBuilder& props) | ||||
| { | { | ||||
| if (project.shouldBuildVST().getValue() || project.isVSTPluginHost()) | |||||
| { | |||||
| props.add (new DependencyPathPropertyComponent (getVSTPathValue (false), "VST SDK Folder"), | |||||
| "If you're building a VST plugin or host, this must be the folder containing the VST SDK. This can be an absolute path, or a path relative to the Projucer project file."); | |||||
| } | |||||
| if (supportsVST3() && (project.shouldBuildVST3().getValue() || project.isVST3PluginHost())) | if (supportsVST3() && (project.shouldBuildVST3().getValue() || project.isVST3PluginHost())) | ||||
| { | { | ||||
| props.add (new DependencyPathPropertyComponent (getVSTPathValue (true), "VST3 SDK Folder"), | |||||
| props.add (new DependencyPathPropertyComponent (getVST3PathValue(), "VST3 SDK Folder"), | |||||
| "If you're building a VST3 plugin or host, this must be the folder containing the VST3 SDK. This can be an absolute path, or a path relative to the Projucer project file."); | "If you're building a VST3 plugin or host, this must be the folder containing the VST3 SDK. This can be an absolute path, or a path relative to the Projucer project file."); | ||||
| } | } | ||||
| @@ -309,16 +303,13 @@ void ProjectExporter::addVSTPathsIfPluginOrHost() | |||||
| if (supportsVST() && project.shouldBuildVST().getValue()) | if (supportsVST() && project.shouldBuildVST().getValue()) | ||||
| makefileTargetSuffix = ".so"; | makefileTargetSuffix = ".so"; | ||||
| if (project.shouldBuildVST().getValue() || project.isVSTPluginHost()) | |||||
| addVSTFolderToPath (false); | |||||
| if (supportsVST3()) | if (supportsVST3()) | ||||
| { | { | ||||
| if (project.shouldBuildVST3().getValue()) | if (project.shouldBuildVST3().getValue()) | ||||
| makefileTargetSuffix = ".so"; | makefileTargetSuffix = ".so"; | ||||
| if (project.shouldBuildVST3().getValue() || project.isVST3PluginHost()) | if (project.shouldBuildVST3().getValue() || project.isVST3PluginHost()) | ||||
| addVSTFolderToPath (true); | |||||
| addVST3FolderToPath(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -333,12 +324,12 @@ void ProjectExporter::addCommonAudioPluginSettings() | |||||
| // Note: RTAS paths are platform-dependent, impl -> addPlatformSpecificSettingsForProjectType | // Note: RTAS paths are platform-dependent, impl -> addPlatformSpecificSettingsForProjectType | ||||
| } | } | ||||
| void ProjectExporter::addVSTFolderToPath (bool isVST3) | |||||
| void ProjectExporter::addVST3FolderToPath() | |||||
| { | { | ||||
| const String vstFolder (getVSTPathValue (isVST3).toString()); | |||||
| const String vst3Folder (getVST3PathValue().toString()); | |||||
| if (vstFolder.isNotEmpty()) | |||||
| addToExtraSearchPaths (RelativePath (vstFolder, RelativePath::projectFolder), 0); | |||||
| if (vst3Folder.isNotEmpty()) | |||||
| addToExtraSearchPaths (RelativePath (vst3Folder, RelativePath::projectFolder), 0); | |||||
| } | } | ||||
| void ProjectExporter::addAAXFoldersToPath() | void ProjectExporter::addAAXFoldersToPath() | ||||
| @@ -131,7 +131,7 @@ public: | |||||
| Value getUserNotes() { return getSetting (Ids::userNotes); } | Value getUserNotes() { return getSetting (Ids::userNotes); } | ||||
| Value getVSTPathValue (bool isVST3) const { return isVST3 ? vst3Path : vst2Path; } | |||||
| Value getVST3PathValue() const { return vst3Path; } | |||||
| Value getRTASPathValue() const { return rtasPath; } | Value getRTASPathValue() const { return rtasPath; } | ||||
| Value getAAXPathValue() const { return aaxPath; } | Value getAAXPathValue() const { return aaxPath; } | ||||
| @@ -341,7 +341,7 @@ protected: | |||||
| const ProjectType& projectType; | const ProjectType& projectType; | ||||
| const String projectName; | const String projectName; | ||||
| const File projectFolder; | const File projectFolder; | ||||
| Value vst2Path, vst3Path, rtasPath, aaxPath; // these must be initialised in the specific exporter c'tors! | |||||
| Value vst3Path, rtasPath, aaxPath; // these must be initialised in the specific exporter c'tors! | |||||
| mutable Array<Project::Item> itemGroups; | mutable Array<Project::Item> itemGroups; | ||||
| void initItemGroups() const; | void initItemGroups() const; | ||||
| @@ -406,7 +406,7 @@ private: | |||||
| void createIconProperties (PropertyListBuilder&); | void createIconProperties (PropertyListBuilder&); | ||||
| void addVSTPathsIfPluginOrHost(); | void addVSTPathsIfPluginOrHost(); | ||||
| void addCommonAudioPluginSettings(); | void addCommonAudioPluginSettings(); | ||||
| void addVSTFolderToPath (bool isVST3); | |||||
| void addVST3FolderToPath(); | |||||
| void addAAXFoldersToPath(); | void addAAXFoldersToPath(); | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectExporter) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectExporter) | ||||
| @@ -55,11 +55,9 @@ namespace Ids | |||||
| DECLARE_ID (intermediatesPath); | DECLARE_ID (intermediatesPath); | ||||
| DECLARE_ID (modulePaths); | DECLARE_ID (modulePaths); | ||||
| DECLARE_ID (searchpaths); | DECLARE_ID (searchpaths); | ||||
| DECLARE_ID (vstFolder); | |||||
| DECLARE_ID (vst3Folder); | DECLARE_ID (vst3Folder); | ||||
| DECLARE_ID (rtasFolder); | DECLARE_ID (rtasFolder); | ||||
| DECLARE_ID (auFolder); | DECLARE_ID (auFolder); | ||||
| DECLARE_ID (vst2Path); | |||||
| DECLARE_ID (vst3Path); | DECLARE_ID (vst3Path); | ||||
| DECLARE_ID (rtasPath); | DECLARE_ID (rtasPath); | ||||
| DECLARE_ID (aaxPath); | DECLARE_ID (aaxPath); | ||||
| @@ -236,7 +236,7 @@ Value StoredSettings::getGlobalPath (const Identifier& key, DependencyPathOS os) | |||||
| String StoredSettings::getFallbackPath (const Identifier& key, DependencyPathOS os) | String StoredSettings::getFallbackPath (const Identifier& key, DependencyPathOS os) | ||||
| { | { | ||||
| if (key == Ids::vst2Path || key == Ids::vst3Path) | |||||
| if (key == Ids::vst3Path) | |||||
| return os == TargetOS::windows ? "c:\\SDKs\\VST3 SDK" | return os == TargetOS::windows ? "c:\\SDKs\\VST3 SDK" | ||||
| : "~/SDKs/VST3 SDK"; | : "~/SDKs/VST3 SDK"; | ||||
| @@ -275,11 +275,7 @@ bool StoredSettings::isGlobalPathValid (const Identifier& key, const String& pat | |||||
| { | { | ||||
| String fileToCheckFor; | String fileToCheckFor; | ||||
| if (key == Ids::vst2Path) | |||||
| { | |||||
| fileToCheckFor = "public.sdk/source/vst2.x/audioeffectx.h"; | |||||
| } | |||||
| else if (key == Ids::vst3Path) | |||||
| if (key == Ids::vst3Path) | |||||
| { | { | ||||
| fileToCheckFor = "base/source/baseiids.cpp"; | fileToCheckFor = "base/source/baseiids.cpp"; | ||||
| } | } | ||||
| @@ -0,0 +1,455 @@ | |||||
| /* | |||||
| ============================================================================== | |||||
| This file is part of the JUCE library. | |||||
| Copyright (c) 2016 - ROLI Ltd. | |||||
| Permission is granted to use this software under the terms of either: | |||||
| a) the GPL v2 (or any later version) | |||||
| b) the Affero GPL v3 | |||||
| Details of these licenses can be found at: www.gnu.org/licenses | |||||
| JUCE is distributed in the hope that it will be useful, but WITHOUT ANY | |||||
| WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | |||||
| A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |||||
| ----------------------------------------------------------------------------- | |||||
| To release a closed-source product which uses JUCE, commercial licenses are | |||||
| available: visit www.juce.com for more information. | |||||
| ============================================================================== | |||||
| */ | |||||
| #ifndef JUCE_VSTINTERFACE_H_INCLUDED | |||||
| #define JUCE_VSTINTERFACE_H_INCLUDED | |||||
| #include "../../juce_core/juce_core.h" | |||||
| using namespace juce; | |||||
| #if JUCE_MSVC | |||||
| #define VSTINTERFACECALL __cdecl | |||||
| #pragma pack(push) | |||||
| #pragma pack(8) | |||||
| #elif JUCE_MAC || JUCE_IOS | |||||
| #define VSTINTERFACECALL | |||||
| #if JUCE_64BIT | |||||
| #pragma options align=power | |||||
| #else | |||||
| #pragma options align=mac68k | |||||
| #endif | |||||
| #else | |||||
| #define VSTINTERFACECALL | |||||
| #pragma pack(push, 8) | |||||
| #endif | |||||
| const int32 juceVstInterfaceVersion = 2400; | |||||
| const int32 juceVstInterfaceIdentifier = 0x56737450; // The "magic" identifier in the SDK is 'VstP'. | |||||
| //============================================================================== | |||||
| struct VstEffectInterface | |||||
| { | |||||
| int32 interfaceIdentifier; | |||||
| pointer_sized_int (VSTINTERFACECALL* dispatchFunction) (VstEffectInterface*, int32 op, int32 index, pointer_sized_int value, void* ptr, float opt); | |||||
| void (VSTINTERFACECALL* processAudioFunction) (VstEffectInterface*, float** inputs, float** outputs, int32 numSamples); | |||||
| void (VSTINTERFACECALL* setParameterValueFunction) (VstEffectInterface*, int32 parameterIndex, float value); | |||||
| float (VSTINTERFACECALL* getParameterValueFunction) (VstEffectInterface*, int32 parameterIndex); | |||||
| int32 numPrograms; | |||||
| int32 numParameters; | |||||
| int32 numInputChannels; | |||||
| int32 numOutputChannels; | |||||
| int32 flags; | |||||
| pointer_sized_int hostSpace1; | |||||
| pointer_sized_int hostSpace2; | |||||
| int32 latency; | |||||
| int32 deprecated1; | |||||
| int32 deprecated2; | |||||
| float deprecated3; | |||||
| void* effectPointer; | |||||
| void* userPointer; | |||||
| int32 plugInIdentifier; | |||||
| int32 plugInVersion; | |||||
| void (VSTINTERFACECALL* processAudioInplaceFunction) (VstEffectInterface*, float** inputs, float** outputs, int32 numSamples); | |||||
| void (VSTINTERFACECALL* processDoubleAudioInplaceFunction) (VstEffectInterface*, double** inputs, double** outputs, int32 numSamples); | |||||
| char emptySpace[56]; | |||||
| }; | |||||
| typedef pointer_sized_int (VSTINTERFACECALL* VstHostCallback) (VstEffectInterface*, int32 op, int32 index, pointer_sized_int value, void* ptr, float opt); | |||||
| enum VstEffectInterfaceFlags | |||||
| { | |||||
| vstEffectFlagHasEditor = 1, | |||||
| vstEffectFlagInplaceAudio = 16, | |||||
| vstEffectFlagDataInChunks = 32, | |||||
| vstEffectFlagIsSynth = 256, | |||||
| vstEffectFlagInplaceDoubleAudio = 4096 | |||||
| }; | |||||
| //============================================================================== | |||||
| enum VstHostToPlugInOpcodes | |||||
| { | |||||
| plugInOpcodeOpen, | |||||
| plugInOpcodeClose, | |||||
| plugInOpcodeSetCurrentProgram, | |||||
| plugInOpcodeGetCurrentProgram, | |||||
| plugInOpcodeSetCurrentProgramName, | |||||
| plugInOpcodeGetCurrentProgramName, | |||||
| plugInOpcodeGetParameterLabel, | |||||
| plugInOpcodeGetParameterText, | |||||
| plugInOpcodeGetParameterName, | |||||
| plugInOpcodeSetSampleRate = plugInOpcodeGetParameterName + 2, | |||||
| plugInOpcodeSetBlockSize, | |||||
| plugInOpcodeResumeSuspend, | |||||
| plugInOpcodeGetEditorBounds, | |||||
| plugInOpcodeOpenEditor, | |||||
| plugInOpcodeCloseEditor, | |||||
| plugInOpcodeEditorIdle = plugInOpcodeCloseEditor + 4, | |||||
| plugInOpcodeeffEditorTop, | |||||
| plugInOpcodeIdentify = plugInOpcodeeffEditorTop + 2, | |||||
| plugInOpcodeGetData, | |||||
| plugInOpcodeSetData, | |||||
| plugInOpcodePreAudioProcessingEvents, | |||||
| plugInOpcodeIsParameterAutomatable, | |||||
| plugInOpcodeParameterValueForText, | |||||
| plugInOpcodeGetProgramName = plugInOpcodeParameterValueForText + 2, | |||||
| plugInOpcodeConnectInput = plugInOpcodeGetProgramName + 2, | |||||
| plugInOpcodeConnectOutput, | |||||
| plugInOpcodeGetInputPinProperties, | |||||
| plugInOpcodeGetOutputPinProperties, | |||||
| plugInOpcodeGetPlugInCategory, | |||||
| plugInOpcodeSetSpeakerConfiguration = plugInOpcodeGetPlugInCategory + 7, | |||||
| plugInOpcodeSetBypass = plugInOpcodeSetSpeakerConfiguration + 2, | |||||
| plugInOpcodeGetPlugInName, | |||||
| plugInOpcodeGetManufacturerName = plugInOpcodeGetPlugInName + 2, | |||||
| plugInOpcodeGetManufacturerProductName, | |||||
| plugInOpcodeGetManufacturerVersion, | |||||
| plugInOpcodeManufacturerSpecific, | |||||
| plugInOpcodeCanPlugInDo, | |||||
| plugInOpcodeGetTailSize, | |||||
| plugInOpcodeIdle, | |||||
| plugInOpcodeKeyboardFocusRequired = plugInOpcodeIdle + 4, | |||||
| plugInOpcodeGetVstInterfaceVersion, | |||||
| plugInOpcodeGetCurrentMidiProgram = plugInOpcodeGetVstInterfaceVersion + 5, | |||||
| plugInOpcodeGetSpeakerArrangement = plugInOpcodeGetCurrentMidiProgram + 6, | |||||
| plugInOpcodeNextPlugInUniqueID, | |||||
| plugInOpcodeStartProcess, | |||||
| plugInOpcodeStopProcess, | |||||
| plugInOpcodeSetNumberOfSamplesToProcess, | |||||
| plugInOpcodeSetSampleFloatType = plugInOpcodeSetNumberOfSamplesToProcess + 4, | |||||
| plugInOpcodeMaximum = plugInOpcodeSetSampleFloatType | |||||
| }; | |||||
| enum VstPlugInToHostOpcodes | |||||
| { | |||||
| hostOpcodeParameterChanged, | |||||
| hostOpcodeVstVersion, | |||||
| hostOpcodeCurrentId, | |||||
| hostOpcodeIdle, | |||||
| hostOpcodePinConnected, | |||||
| hostOpcodePlugInWantsMidi = hostOpcodePinConnected + 2, | |||||
| hostOpcodeGetTimingInfo, | |||||
| hostOpcodePreAudioProcessingEvents, | |||||
| hostOpcodeSetTime, | |||||
| hostOpcodeTempoAt, | |||||
| hostOpcodeGetNumberOfAutomatableParameters, | |||||
| hostOpcodeGetParameterInterval, | |||||
| hostOpcodeIOModified, | |||||
| hostOpcodeNeedsIdle, | |||||
| hostOpcodeWindowSize, | |||||
| hostOpcodeGetSampleRate, | |||||
| hostOpcodeGetBlockSize, | |||||
| hostOpcodeGetInputLatency, | |||||
| hostOpcodeGetOutputLatency, | |||||
| hostOpcodeGetPreviousPlugIn, | |||||
| hostOpcodeGetNextPlugIn, | |||||
| hostOpcodeWillReplace, | |||||
| hostOpcodeGetCurrentAudioProcessingLevel, | |||||
| hostOpcodeGetAutomationState, | |||||
| hostOpcodeOfflineStart, | |||||
| hostOpcodeOfflineReadSource, | |||||
| hostOpcodeOfflineWrite, | |||||
| hostOpcodeOfflineGetCurrentPass, | |||||
| hostOpcodeOfflineGetCurrentMetaPass, | |||||
| hostOpcodeSetOutputSampleRate, | |||||
| hostOpcodeGetOutputSpeakerConfiguration, | |||||
| hostOpcodeGetManufacturerName, | |||||
| hostOpcodeGetProductName, | |||||
| hostOpcodeGetManufacturerVersion, | |||||
| hostOpcodeManufacturerSpecific, | |||||
| hostOpcodeSetIcon, | |||||
| hostOpcodeCanHostDo, | |||||
| hostOpcodeGetLanguage, | |||||
| hostOpcodeOpenEditorWindow, | |||||
| hostOpcodeCloseEditorWindow, | |||||
| hostOpcodeGetDirectory, | |||||
| hostOpcodeUpdateView, | |||||
| hostOpcodeParameterChangeGestureBegin, | |||||
| hostOpcodeParameterChangeGestureEnd, | |||||
| }; | |||||
| //============================================================================== | |||||
| enum VstProcessingSampleType | |||||
| { | |||||
| vstProcessingSampleTypeFloat, | |||||
| vstProcessingSampleTypeDouble | |||||
| }; | |||||
| //============================================================================== | |||||
| // These names must be identical to the Steinberg SDK so JUCE users can set | |||||
| // exactly what they want. | |||||
| enum VstPlugInCategory | |||||
| { | |||||
| kPlugCategUnknown, | |||||
| kPlugCategEffect, | |||||
| kPlugCategSynth, | |||||
| kPlugCategAnalysis, | |||||
| kPlugCategMastering, | |||||
| kPlugCategSpacializer, | |||||
| kPlugCategRoomFx, | |||||
| kPlugSurroundFx, | |||||
| kPlugCategRestoration, | |||||
| kPlugCategOfflineProcess, | |||||
| kPlugCategShell, | |||||
| kPlugCategGenerator | |||||
| }; | |||||
| //============================================================================== | |||||
| struct VstEditorBounds | |||||
| { | |||||
| int16 upper; | |||||
| int16 leftmost; | |||||
| int16 lower; | |||||
| int16 rightmost; | |||||
| }; | |||||
| //============================================================================== | |||||
| enum VstMaxStringLengths | |||||
| { | |||||
| vstMaxNameLength = 64, | |||||
| vstMaxParameterOrPinLabelLength = 64, | |||||
| vstMaxParameterOrPinShortLabelLength = 8, | |||||
| vstMaxCategoryLength = 24, | |||||
| vstMaxManufacturerStringLength = 64, | |||||
| vstMaxPlugInNameStringLength = 64 | |||||
| }; | |||||
| //============================================================================== | |||||
| struct VstPinInfo | |||||
| { | |||||
| char text[vstMaxParameterOrPinLabelLength]; | |||||
| int32 flags; | |||||
| int32 configurationType; | |||||
| char shortText[vstMaxParameterOrPinShortLabelLength]; | |||||
| char unused[48]; | |||||
| }; | |||||
| enum VstPinInfoFlags | |||||
| { | |||||
| vstPinInfoFlagIsActive = 1, | |||||
| vstPinInfoFlagIsStereo = 2, | |||||
| vstPinInfoFlagValid = 4 | |||||
| }; | |||||
| //============================================================================== | |||||
| struct VstEvent | |||||
| { | |||||
| int32 type; | |||||
| int32 size; | |||||
| int32 sampleOffset; | |||||
| int32 flags; | |||||
| char content[16]; | |||||
| }; | |||||
| enum VstEventTypes | |||||
| { | |||||
| vstMidiEventType = 1, | |||||
| vstSysExEventType = 6 | |||||
| }; | |||||
| struct VstEventBlock | |||||
| { | |||||
| int32 numberOfEvents; | |||||
| pointer_sized_int future; | |||||
| VstEvent* events[2]; | |||||
| }; | |||||
| struct VstMidiEvent | |||||
| { | |||||
| int32 type; | |||||
| int32 size; | |||||
| int32 sampleOffset; | |||||
| int32 flags; | |||||
| int32 noteSampleLength; | |||||
| int32 noteSampleOffset; | |||||
| char midiData[4]; | |||||
| char tuning; | |||||
| char noteVelocityOff; | |||||
| char future1; | |||||
| char future2; | |||||
| }; | |||||
| enum VstMidiEventFlags | |||||
| { | |||||
| vstMidiEventIsRealtime = 1 | |||||
| }; | |||||
| struct VstSysExEvent | |||||
| { | |||||
| int32 type; | |||||
| int32 size; | |||||
| int32 offsetSamples; | |||||
| int32 flags; | |||||
| int32 sysExDumpSize; | |||||
| pointer_sized_int future1; | |||||
| char* sysExDump; | |||||
| pointer_sized_int future2; | |||||
| }; | |||||
| //============================================================================== | |||||
| struct VstTimingInformation | |||||
| { | |||||
| double samplePosition; | |||||
| double sampleRate; | |||||
| double systemTimeNanoseconds; | |||||
| double musicalPosition; | |||||
| double tempoBPM; | |||||
| double lastBarPosition; | |||||
| double loopStartPosition; | |||||
| double loopEndPosition; | |||||
| int32 timeSignatureNumerator; | |||||
| int32 timeSignatureDenominator; | |||||
| int32 smpteOffset; | |||||
| int32 smpteRate; | |||||
| int32 samplesToNearestClock; | |||||
| int32 flags; | |||||
| }; | |||||
| enum VstTimingInformationFlags | |||||
| { | |||||
| vstTimingInfoFlagTransportChanged = 1, | |||||
| vstTimingInfoFlagCurrentlyPlaying = 2, | |||||
| vstTimingInfoFlagLoopActive = 4, | |||||
| vstTimingInfoFlagCurrentlyRecording = 8, | |||||
| vstTimingInfoFlagAutomationWriteModeActive = 64, | |||||
| vstTimingInfoFlagAutomationReadModeActive = 128, | |||||
| vstTimingInfoFlagNanosecondsValid = 256, | |||||
| vstTimingInfoFlagMusicalPositionValid = 512, | |||||
| vstTimingInfoFlagTempoValid = 1024, | |||||
| vstTimingInfoFlagLastBarPositionValid = 2056, | |||||
| vstTimingInfoFlagLoopPositionValid = 4096, | |||||
| vstTimingInfoFlagTimeSignatureValid = 8192, | |||||
| vstTimingInfoFlagSmpteValid = 16384, | |||||
| vstTimingInfoFlagNearestClockValid = 32768 | |||||
| }; | |||||
| //============================================================================== | |||||
| enum VstSmpteRates | |||||
| { | |||||
| vstSmpteRateFps24, | |||||
| vstSmpteRateFps25, | |||||
| vstSmpteRateFps2997, | |||||
| vstSmpteRateFps30, | |||||
| vstSmpteRateFps2997drop, | |||||
| vstSmpteRateFps30drop, | |||||
| vstSmpteRate16mmFilm, | |||||
| vstSmpteRate35mmFilm, | |||||
| vstSmpteRateFps239 = vstSmpteRate35mmFilm + 3, | |||||
| vstSmpteRateFps249 , | |||||
| vstSmpteRateFps599, | |||||
| vstSmpteRateFps60 | |||||
| }; | |||||
| //============================================================================== | |||||
| struct VstIndividualSpeakerInfo | |||||
| { | |||||
| float azimuthalAngle; | |||||
| float elevationAngle; | |||||
| float radius; | |||||
| float reserved; | |||||
| char label[vstMaxNameLength]; | |||||
| int32 type; | |||||
| char unused[28]; | |||||
| }; | |||||
| enum VstIndividualSpeakerType | |||||
| { | |||||
| vstIndividualSpeakerTypeUndefined = 0x7fffffff, | |||||
| vstIndividualSpeakerTypeMono = 0, | |||||
| vstIndividualSpeakerTypeLeft, | |||||
| vstIndividualSpeakerTypeRight, | |||||
| vstIndividualSpeakerTypeCentre, | |||||
| vstIndividualSpeakerTypeSubbass, | |||||
| vstIndividualSpeakerTypeLeftSurround, | |||||
| vstIndividualSpeakerTypeRightSurround, | |||||
| vstIndividualSpeakerTypeLeftCentre, | |||||
| vstIndividualSpeakerTypeRightCentre, | |||||
| vstIndividualSpeakerTypeSurround, | |||||
| vstIndividualSpeakerTypeCentreSurround = vstIndividualSpeakerTypeSurround, | |||||
| vstIndividualSpeakerTypeLeftRearSurround, | |||||
| vstIndividualSpeakerTypeRightRearSurround, | |||||
| vstIndividualSpeakerTypeTopMiddle, | |||||
| vstIndividualSpeakerTypeTopFrontLeft, | |||||
| vstIndividualSpeakerTypeTopFrontCentre, | |||||
| vstIndividualSpeakerTypeTopFrontRight, | |||||
| vstIndividualSpeakerTypeTopRearLeft, | |||||
| vstIndividualSpeakerTypeTopRearCentre, | |||||
| vstIndividualSpeakerTypeTopRearRight, | |||||
| vstIndividualSpeakerTypeSubbass2 | |||||
| }; | |||||
| struct VstSpeakerConfiguration | |||||
| { | |||||
| int32 type; | |||||
| int32 numberOfChannels; | |||||
| VstIndividualSpeakerInfo speakers[8]; | |||||
| }; | |||||
| enum VstSpeakerConfigurationType | |||||
| { | |||||
| vstSpeakerConfigTypeUser = -2, | |||||
| vstSpeakerConfigTypeEmpty = -1, | |||||
| vstSpeakerConfigTypeMono = 0, | |||||
| vstSpeakerConfigTypeLR, | |||||
| vstSpeakerConfigTypeLsRs, | |||||
| vstSpeakerConfigTypeLcRc, | |||||
| vstSpeakerConfigTypeSlSr, | |||||
| vstSpeakerConfigTypeCLfe, | |||||
| vstSpeakerConfigTypeLRC, | |||||
| vstSpeakerConfigTypeLRS, | |||||
| vstSpeakerConfigTypeLRCLfe, | |||||
| vstSpeakerConfigTypeLRLfeS, | |||||
| vstSpeakerConfigTypeLRCS, | |||||
| vstSpeakerConfigTypeLRLsRs, | |||||
| vstSpeakerConfigTypeLRCLfeS, | |||||
| vstSpeakerConfigTypeLRLfeLsRs, | |||||
| vstSpeakerConfigTypeLRCLsRs, | |||||
| vstSpeakerConfigTypeLRCLfeLsRs, | |||||
| vstSpeakerConfigTypeLRCLsRsCs, | |||||
| vstSpeakerConfigTypeLRLsRsSlSr, | |||||
| vstSpeakerConfigTypeLRCLfeLsRsCs, | |||||
| vstSpeakerConfigTypeLRLfeLsRsSlSr, | |||||
| vstSpeakerConfigTypeLRCLsRsLcRc, | |||||
| vstSpeakerConfigTypeLRCLsRsSlSr, | |||||
| vstSpeakerConfigTypeLRCLfeLsRsLcRc, | |||||
| vstSpeakerConfigTypeLRCLfeLsRsSlSr, | |||||
| vstSpeakerConfigTypeLRCLsRsLcRcCs, | |||||
| vstSpeakerConfigTypeLRCLsRsCsSlSr, | |||||
| vstSpeakerConfigTypeLRCLfeLsRsLcRcCs, | |||||
| vstSpeakerConfigTypeLRCLfeLsRsCsSlSr, | |||||
| vstSpeakerConfigTypeLRCLfeLsRsTflTfcTfrTrlTrrLfe2 | |||||
| }; | |||||
| #if JUCE_MSVC | |||||
| #pragma pack(pop) | |||||
| #elif JUCE_MAC || JUCE_IOS | |||||
| #pragma options align=reset | |||||
| #else | |||||
| #pragma pack(pop) | |||||
| #endif | |||||
| #endif // JUCE_VSTINTERFACE_H_INCLUDED | |||||
| @@ -22,7 +22,8 @@ | |||||
| ============================================================================== | ============================================================================== | ||||
| */ | */ | ||||
| #ifdef __aeffect__ // NB: this must come first, *before* the header-guard. | |||||
| // NB: this must come first, *before* the header-guard. | |||||
| #ifdef JUCE_VSTINTERFACE_H_INCLUDED | |||||
| #ifndef JUCE_VSTMIDIEVENTLIST_H_INCLUDED | #ifndef JUCE_VSTMIDIEVENTLIST_H_INCLUDED | ||||
| #define JUCE_VSTMIDIEVENTLIST_H_INCLUDED | #define JUCE_VSTMIDIEVENTLIST_H_INCLUDED | ||||
| @@ -53,7 +54,7 @@ public: | |||||
| numEventsUsed = 0; | numEventsUsed = 0; | ||||
| if (events != nullptr) | if (events != nullptr) | ||||
| events->numEvents = 0; | |||||
| events->numberOfEvents = 0; | |||||
| } | } | ||||
| void addEvent (const void* const midiData, const int numBytes, const int frameOffset) | void addEvent (const void* const midiData, const int numBytes, const int frameOffset) | ||||
| @@ -61,65 +62,65 @@ public: | |||||
| ensureSize (numEventsUsed + 1); | ensureSize (numEventsUsed + 1); | ||||
| VstMidiEvent* const e = (VstMidiEvent*) (events->events [numEventsUsed]); | VstMidiEvent* const e = (VstMidiEvent*) (events->events [numEventsUsed]); | ||||
| events->numEvents = ++numEventsUsed; | |||||
| events->numberOfEvents = ++numEventsUsed; | |||||
| if (numBytes <= 4) | if (numBytes <= 4) | ||||
| { | { | ||||
| if (e->type == kVstSysExType) | |||||
| if (e->type == vstSysExEventType) | |||||
| { | { | ||||
| delete[] (((VstMidiSysexEvent*) e)->sysexDump); | |||||
| e->type = kVstMidiType; | |||||
| e->byteSize = sizeof (VstMidiEvent); | |||||
| e->noteLength = 0; | |||||
| e->noteOffset = 0; | |||||
| e->detune = 0; | |||||
| e->noteOffVelocity = 0; | |||||
| delete[] (((VstSysExEvent*) e)->sysExDump); | |||||
| e->type = vstMidiEventType; | |||||
| e->size = sizeof (VstMidiEvent); | |||||
| e->noteSampleLength = 0; | |||||
| e->noteSampleOffset = 0; | |||||
| e->tuning = 0; | |||||
| e->noteVelocityOff = 0; | |||||
| } | } | ||||
| e->deltaFrames = frameOffset; | |||||
| e->sampleOffset = frameOffset; | |||||
| memcpy (e->midiData, midiData, (size_t) numBytes); | memcpy (e->midiData, midiData, (size_t) numBytes); | ||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| VstMidiSysexEvent* const se = (VstMidiSysexEvent*) e; | |||||
| VstSysExEvent* const se = (VstSysExEvent*) e; | |||||
| if (se->type == kVstSysExType) | |||||
| delete[] se->sysexDump; | |||||
| if (se->type == vstSysExEventType) | |||||
| delete[] se->sysExDump; | |||||
| se->sysexDump = new char [(size_t) numBytes]; | |||||
| memcpy (se->sysexDump, midiData, (size_t) numBytes); | |||||
| se->sysExDump = new char [(size_t) numBytes]; | |||||
| memcpy (se->sysExDump, midiData, (size_t) numBytes); | |||||
| se->type = kVstSysExType; | |||||
| se->byteSize = sizeof (VstMidiSysexEvent); | |||||
| se->deltaFrames = frameOffset; | |||||
| se->type = vstSysExEventType; | |||||
| se->size = sizeof (VstSysExEvent); | |||||
| se->offsetSamples = frameOffset; | |||||
| se->flags = 0; | se->flags = 0; | ||||
| se->dumpBytes = numBytes; | |||||
| se->resvd1 = 0; | |||||
| se->resvd2 = 0; | |||||
| se->sysExDumpSize = numBytes; | |||||
| se->future1 = 0; | |||||
| se->future2 = 0; | |||||
| } | } | ||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| // Handy method to pull the events out of an event buffer supplied by the host | // Handy method to pull the events out of an event buffer supplied by the host | ||||
| // or plugin. | // or plugin. | ||||
| static void addEventsToMidiBuffer (const VstEvents* events, MidiBuffer& dest) | |||||
| static void addEventsToMidiBuffer (const VstEventBlock* events, MidiBuffer& dest) | |||||
| { | { | ||||
| for (int i = 0; i < events->numEvents; ++i) | |||||
| for (int i = 0; i < events->numberOfEvents; ++i) | |||||
| { | { | ||||
| const VstEvent* const e = events->events[i]; | const VstEvent* const e = events->events[i]; | ||||
| if (e != nullptr) | if (e != nullptr) | ||||
| { | { | ||||
| if (e->type == kVstMidiType) | |||||
| if (e->type == vstMidiEventType) | |||||
| { | { | ||||
| dest.addEvent ((const juce::uint8*) ((const VstMidiEvent*) e)->midiData, | dest.addEvent ((const juce::uint8*) ((const VstMidiEvent*) e)->midiData, | ||||
| 4, e->deltaFrames); | |||||
| 4, e->sampleOffset); | |||||
| } | } | ||||
| else if (e->type == kVstSysExType) | |||||
| else if (e->type == vstSysExEventType) | |||||
| { | { | ||||
| dest.addEvent ((const juce::uint8*) ((const VstMidiSysexEvent*) e)->sysexDump, | |||||
| (int) ((const VstMidiSysexEvent*) e)->dumpBytes, | |||||
| e->deltaFrames); | |||||
| dest.addEvent ((const juce::uint8*) ((const VstSysExEvent*) e)->sysExDump, | |||||
| (int) ((const VstSysExEvent*) e)->sysExDumpSize, | |||||
| e->sampleOffset); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -160,24 +161,24 @@ public: | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| HeapBlock<VstEvents> events; | |||||
| HeapBlock<VstEventBlock> events; | |||||
| private: | private: | ||||
| int numEventsUsed, numEventsAllocated; | int numEventsUsed, numEventsAllocated; | ||||
| static VstEvent* allocateVSTEvent() | static VstEvent* allocateVSTEvent() | ||||
| { | { | ||||
| VstEvent* const e = (VstEvent*) std::calloc (1, sizeof (VstMidiEvent) > sizeof (VstMidiSysexEvent) ? sizeof (VstMidiEvent) | |||||
| : sizeof (VstMidiSysexEvent)); | |||||
| e->type = kVstMidiType; | |||||
| e->byteSize = sizeof (VstMidiEvent); | |||||
| VstEvent* const e = (VstEvent*) std::calloc (1, sizeof (VstMidiEvent) > sizeof (VstSysExEvent) ? sizeof (VstMidiEvent) | |||||
| : sizeof (VstSysExEvent)); | |||||
| e->type = vstMidiEventType; | |||||
| e->size = sizeof (VstMidiEvent); | |||||
| return e; | return e; | ||||
| } | } | ||||
| static void freeVSTEvent (VstEvent* e) | static void freeVSTEvent (VstEvent* e) | ||||
| { | { | ||||
| if (e->type == kVstSysExType) | |||||
| delete[] (((VstMidiSysexEvent*) e)->sysexDump); | |||||
| if (e->type == vstSysExEventType) | |||||
| delete[] (((VstSysExEvent*) e)->sysExDump); | |||||
| std::free (e); | std::free (e); | ||||
| } | } | ||||
| @@ -82,14 +82,8 @@ public: | |||||
| static void setExtraFunctions (AudioPluginInstance* plugin, ExtraFunctions* functions); | static void setExtraFunctions (AudioPluginInstance* plugin, ExtraFunctions* functions); | ||||
| //============================================================================== | //============================================================================== | ||||
| #if JUCE_64BIT | |||||
| typedef int64 VstIntPtr; | |||||
| #else | |||||
| typedef int32 VstIntPtr; | |||||
| #endif | |||||
| /** This simply calls directly to the VST's AEffect::dispatcher() function. */ | /** This simply calls directly to the VST's AEffect::dispatcher() function. */ | ||||
| static VstIntPtr JUCE_CALLTYPE dispatcher (AudioPluginInstance*, int32, int32, VstIntPtr, void*, float); | |||||
| static pointer_sized_int JUCE_CALLTYPE dispatcher (AudioPluginInstance*, int32, int32, pointer_sized_int, void*, float); | |||||
| //============================================================================== | //============================================================================== | ||||
| String getName() const override { return "VST"; } | String getName() const override { return "VST"; } | ||||
| @@ -57,8 +57,7 @@ | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Config: JUCE_PLUGINHOST_VST | /** Config: JUCE_PLUGINHOST_VST | ||||
| Enables the VST audio plugin hosting classes. This requires the Steinberg VST SDK to be | |||||
| installed on your machine. | |||||
| Enables the VST audio plugin hosting classes. | |||||
| @see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU, JUCE_PLUGINHOST_VST3 | @see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU, JUCE_PLUGINHOST_VST3 | ||||
| */ | */ | ||||