Browse Source

Use a bespoke VST2 interface

tags/2021-05-28
tpoole 8 years ago
parent
commit
9f31d6498a
17 changed files with 1687 additions and 1038 deletions
  1. +0
    -2
      extras/Projucer/Source/Application/jucer_GlobalPreferences.cpp
  2. +0
    -1
      extras/Projucer/Source/Application/jucer_GlobalPreferences.h
  3. +0
    -1
      extras/Projucer/Source/LiveBuildEngine/projucer_CompileEngineClient.cpp
  4. +0
    -1
      extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h
  5. +0
    -4
      extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h
  6. +0
    -4
      extras/Projucer/Source/Project Saving/jucer_ProjectExport_Make.h
  7. +0
    -1
      extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  8. +6
    -15
      extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp
  9. +3
    -3
      extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h
  10. +0
    -2
      extras/Projucer/Source/Utility/jucer_PresetIDs.h
  11. +2
    -6
      extras/Projucer/Source/Utility/jucer_StoredSettings.cpp
  12. +925
    -699
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  13. +455
    -0
      modules/juce_audio_processors/format_types/juce_VSTInterface.h
  14. +39
    -38
      modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h
  15. +255
    -252
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  16. +1
    -7
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h
  17. +1
    -2
      modules/juce_audio_processors/juce_audio_processors.h

+ 0
- 2
extras/Projucer/Source/Application/jucer_GlobalPreferences.cpp View File

@@ -34,7 +34,6 @@ PathSettingsTab::PathSettingsTab (DependencyPathOS os)
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));
#if ! JUCE_LINUX
@@ -70,7 +69,6 @@ void PathSettingsTab::textPropertyComponentChanged (TextPropertyComponent* textP
Identifier PathSettingsTab::getKeyForPropertyComponent (TextPropertyComponent* component) const
{
if (component == vst2PathComponent) return Ids::vst2Path;
if (component == vst3PathComponent) return Ids::vst3Path;
if (component == rtasPathComponent) return Ids::rtasPath;
if (component == aaxPathComponent) return Ids::aaxPath;


+ 0
- 1
extras/Projucer/Source/Application/jucer_GlobalPreferences.h View File

@@ -64,7 +64,6 @@ private:
OwnedArray<TextPropertyComponent> pathComponents;
TextPropertyComponent* vst2PathComponent;
TextPropertyComponent* vst3PathComponent;
TextPropertyComponent* rtasPathComponent;
TextPropertyComponent* aaxPathComponent;


+ 0
- 1
extras/Projucer/Source/LiveBuildEngine/projucer_CompileEngineClient.cpp View File

@@ -481,7 +481,6 @@ private:
if (project.getProjectType().isAudioPlugin())
{
paths.add (getAppSettings().getGlobalPath (Ids::vst2Path, TargetOS::getThisOS()).toString());
paths.add (getAppSettings().getGlobalPath (Ids::vst3Path, TargetOS::getThisOS()).toString());
}


+ 0
- 1
extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h View File

@@ -433,7 +433,6 @@ private:
DependencyPathOS pathOS = isLinux() ? TargetOS::linux
: TargetOS::windows;
vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder), Ids::vst2Path, pathOS)));
vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, pathOS)));
if (! isLinux())


+ 0
- 4
extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h View File

@@ -749,10 +749,6 @@ protected:
void initialiseDependencyPathValues()
{
vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder),
Ids::vst2Path,
TargetOS::windows)));
vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder),
Ids::vst3Path,
TargetOS::windows)));


+ 0
- 4
extras/Projucer/Source/Project Saving/jucer_ProjectExport_Make.h View File

@@ -473,10 +473,6 @@ private:
void initialiseDependencyPathValues()
{
vst2Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vstFolder),
Ids::vst2Path,
TargetOS::linux)));
vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder),
Ids::vst3Path,
TargetOS::linux)));


+ 0
- 1
extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -2706,7 +2706,6 @@ private:
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)));
aaxPath. referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, TargetOS::osx)));
rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, TargetOS::osx)));


+ 6
- 15
extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp View File

@@ -242,15 +242,9 @@ void ProjectExporter::createPropertyEditors (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()))
{
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.");
}
@@ -309,16 +303,13 @@ void ProjectExporter::addVSTPathsIfPluginOrHost()
if (supportsVST() && project.shouldBuildVST().getValue())
makefileTargetSuffix = ".so";
if (project.shouldBuildVST().getValue() || project.isVSTPluginHost())
addVSTFolderToPath (false);
if (supportsVST3())
{
if (project.shouldBuildVST3().getValue())
makefileTargetSuffix = ".so";
if (project.shouldBuildVST3().getValue() || project.isVST3PluginHost())
addVSTFolderToPath (true);
addVST3FolderToPath();
}
}
@@ -333,12 +324,12 @@ void ProjectExporter::addCommonAudioPluginSettings()
// 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()


+ 3
- 3
extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h View File

@@ -131,7 +131,7 @@ public:
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 getAAXPathValue() const { return aaxPath; }
@@ -341,7 +341,7 @@ protected:
const ProjectType& projectType;
const String projectName;
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;
void initItemGroups() const;
@@ -406,7 +406,7 @@ private:
void createIconProperties (PropertyListBuilder&);
void addVSTPathsIfPluginOrHost();
void addCommonAudioPluginSettings();
void addVSTFolderToPath (bool isVST3);
void addVST3FolderToPath();
void addAAXFoldersToPath();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectExporter)


+ 0
- 2
extras/Projucer/Source/Utility/jucer_PresetIDs.h View File

@@ -55,11 +55,9 @@ namespace Ids
DECLARE_ID (intermediatesPath);
DECLARE_ID (modulePaths);
DECLARE_ID (searchpaths);
DECLARE_ID (vstFolder);
DECLARE_ID (vst3Folder);
DECLARE_ID (rtasFolder);
DECLARE_ID (auFolder);
DECLARE_ID (vst2Path);
DECLARE_ID (vst3Path);
DECLARE_ID (rtasPath);
DECLARE_ID (aaxPath);


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

@@ -236,7 +236,7 @@ Value StoredSettings::getGlobalPath (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"
: "~/SDKs/VST3 SDK";
@@ -275,11 +275,7 @@ bool StoredSettings::isGlobalPathValid (const Identifier& key, const String& pat
{
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";
}


+ 925
- 699
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
File diff suppressed because it is too large
View File


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

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

+ 39
- 38
modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h View File

@@ -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
#define JUCE_VSTMIDIEVENTLIST_H_INCLUDED
@@ -53,7 +54,7 @@ public:
numEventsUsed = 0;
if (events != nullptr)
events->numEvents = 0;
events->numberOfEvents = 0;
}
void addEvent (const void* const midiData, const int numBytes, const int frameOffset)
@@ -61,65 +62,65 @@ public:
ensureSize (numEventsUsed + 1);
VstMidiEvent* const e = (VstMidiEvent*) (events->events [numEventsUsed]);
events->numEvents = ++numEventsUsed;
events->numberOfEvents = ++numEventsUsed;
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);
}
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->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
// 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];
if (e != nullptr)
{
if (e->type == kVstMidiType)
if (e->type == vstMidiEventType)
{
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:
int numEventsUsed, numEventsAllocated;
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;
}
static void freeVSTEvent (VstEvent* e)
{
if (e->type == kVstSysExType)
delete[] (((VstMidiSysexEvent*) e)->sysexDump);
if (e->type == vstSysExEventType)
delete[] (((VstSysExEvent*) e)->sysExDump);
std::free (e);
}


+ 255
- 252
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
File diff suppressed because it is too large
View File


+ 1
- 7
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h View File

@@ -82,14 +82,8 @@ public:
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. */
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"; }


+ 1
- 2
modules/juce_audio_processors/juce_audio_processors.h View File

@@ -57,8 +57,7 @@
//==============================================================================
/** 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
*/


Loading…
Cancel
Save