From 3b2ff2be4ee8164be1e9bc40558ff72951ada4e4 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 27 Aug 2013 22:39:13 +0100 Subject: [PATCH] Added a method VSTPluginFormat::dispatcher() to allow raw access to a VST's dispatcher function. --- .../format_types/juce_VSTPluginFormat.cpp | 8 ++++++++ .../format_types/juce_VSTPluginFormat.h | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 647ec848c3..f86732efee 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2863,4 +2863,12 @@ void VSTPluginFormat::setExtraFunctions (AudioPluginInstance* plugin, ExtraFunct vst->extraFunctions = f; } +VstIntPtr JUCE_CALLTYPE dispatcher (AudioPluginInstance* plugin, int32 opcode, int32 index, VstIntPtr value, void* ptr, float opt) +{ + if (VSTPluginInstance* vst = dynamic_cast (plugin)) + return vst->dispatch (opcode, index, value, ptr, opt); + + return 0; +} + #endif diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h index d248eb029f..aeb838fefc 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h @@ -79,6 +79,16 @@ 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); + //============================================================================== String getName() const override { return "VST"; } void findAllTypesForFile (OwnedArray &, const String& fileOrIdentifier) override;