Browse Source

Compile fix for PluginListComponent. Hack to allow some internal customisation of VST entry points.

tags/2021-05-28
jules 12 years ago
parent
commit
af559c47ee
2 changed files with 21 additions and 6 deletions
  1. +19
    -6
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  2. +2
    -0
      modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp

+ 19
- 6
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -72,6 +72,14 @@
static void _clearfp() {} static void _clearfp() {}
#endif #endif
#ifndef JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
#define JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
#endif
#ifndef JUCE_VST_WRAPPER_INVOKE_MAIN
#define JUCE_VST_WRAPPER_INVOKE_MAIN effect = module->moduleMain (&audioMaster);
#endif
//============================================================================== //==============================================================================
const int fxbVersionNum = 1; const int fxbVersionNum = 1;
@@ -337,7 +345,7 @@ class ModuleHandle : public ReferenceCountedObject
public: public:
//============================================================================== //==============================================================================
File file; File file;
MainCall moduleMain;
MainCall moduleMain, customMain;
String pluginName; String pluginName;
ScopedPointer<XmlElement> vstXml; ScopedPointer<XmlElement> vstXml;
@@ -380,7 +388,8 @@ public:
//============================================================================== //==============================================================================
ModuleHandle (const File& file_) ModuleHandle (const File& file_)
: file (file_), : file (file_),
moduleMain (0)
moduleMain (nullptr),
customMain (nullptr)
#if JUCE_MAC #if JUCE_MAC
#if JUCE_PPC #if JUCE_PPC
, fragId (0) , fragId (0)
@@ -431,6 +440,8 @@ public:
if (moduleMain == nullptr) if (moduleMain == nullptr)
moduleMain = (MainCall) module.getFunction ("main"); moduleMain = (MainCall) module.getFunction ("main");
JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
if (moduleMain != nullptr) if (moduleMain != nullptr)
{ {
vstXml = XmlDocument::parse (file.withFileExtension ("vstxml")); vstXml = XmlDocument::parse (file.withFileExtension ("vstxml"));
@@ -506,10 +517,12 @@ public:
{ {
moduleMain = (MainCall) CFBundleGetFunctionPointerForName (bundleRef, CFSTR("main_macho")); moduleMain = (MainCall) CFBundleGetFunctionPointerForName (bundleRef, CFSTR("main_macho"));
if (moduleMain == 0)
if (moduleMain == nullptr)
moduleMain = (MainCall) CFBundleGetFunctionPointerForName (bundleRef, CFSTR("VSTPluginMain")); moduleMain = (MainCall) CFBundleGetFunctionPointerForName (bundleRef, CFSTR("VSTPluginMain"));
if (moduleMain != 0)
JUCE_VST_WRAPPER_LOAD_CUSTOM_MAIN
if (moduleMain != nullptr)
{ {
if (CFTypeRef name = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleName"))) if (CFTypeRef name = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleName")))
{ {
@@ -611,7 +624,7 @@ public:
#if JUCE_PPC #if JUCE_PPC
if (fragId != 0) if (fragId != 0)
{ {
if (moduleMain != 0)
if (moduleMain != nullptr)
disposeMachOFromCFM ((void*) moduleMain); disposeMachOFromCFM ((void*) moduleMain);
CloseConnection (&fragId); CloseConnection (&fragId);
@@ -744,7 +757,7 @@ public:
#endif #endif
#endif #endif
{ {
effect = module->moduleMain (&audioMaster);
JUCE_VST_WRAPPER_INVOKE_MAIN
} }
if (effect != nullptr && effect->magic == kEffectMagic) if (effect != nullptr && effect->magic == kEffectMagic)


+ 2
- 0
modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp View File

@@ -317,6 +317,8 @@ private:
double progress; double progress;
bool finished; bool finished;
PluginDirectoryScanner scanner; PluginDirectoryScanner scanner;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Scanner)
}; };
void PluginListComponent::scanFor (AudioPluginFormat* format) void PluginListComponent::scanFor (AudioPluginFormat* format)


Loading…
Cancel
Save