|
|
|
@@ -187,6 +187,7 @@ static VstIntPtr VSTCALLBACK audioMaster (AEffect* effect, VstInt32 opcode, VstI |
|
|
|
static int shellUIDToCreate = 0;
|
|
|
|
static int insideVSTCallback = 0;
|
|
|
|
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
class IdleCallRecursionPreventer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
@@ -210,6 +211,9 @@ private: |
|
|
|
};
|
|
|
|
|
|
|
|
class VSTPluginWindow;
|
|
|
|
#else
|
|
|
|
struct IdleCallRecursionPreventer{};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
// Change this to disable logging of various VST activities
|
|
|
|
@@ -236,6 +240,7 @@ static void* NewCFMFromMachO (void* const machofp) noexcept |
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
//==============================================================================
|
|
|
|
#if JUCE_LINUX
|
|
|
|
|
|
|
|
@@ -340,6 +345,7 @@ namespace |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
@@ -710,9 +716,13 @@ static const int defaultVSTBlockSizeValue = 512; |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
//==============================================================================
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
class VSTPluginInstance : public AudioPluginInstance,
|
|
|
|
private Timer,
|
|
|
|
private AsyncUpdater
|
|
|
|
#else
|
|
|
|
class VSTPluginInstance : public AudioPluginInstance
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VSTPluginInstance (const ModuleHandle::Ptr& module_)
|
|
|
|
@@ -783,8 +793,10 @@ public: |
|
|
|
UseResFile (module->resFileId);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
// Must delete any editors before deleting the plugin instance!
|
|
|
|
jassert (getActiveEditor() == 0);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
_fpreset(); // some dodgy plugs fuck around with this
|
|
|
|
|
|
|
|
@@ -1242,6 +1254,7 @@ public: |
|
|
|
void setCurrentProgramStateInformation (const void* data, int size) override { loadFromFXBFile (data, size); }
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
void timerCallback() override
|
|
|
|
{
|
|
|
|
if (dispatch (effIdle, 0, 0, 0, 0) == 0)
|
|
|
|
@@ -1253,6 +1266,7 @@ public: |
|
|
|
// indicates that something about the plugin has changed..
|
|
|
|
updateHostDisplay();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
VstIntPtr handleCallback (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt)
|
|
|
|
{
|
|
|
|
@@ -1270,6 +1284,7 @@ public: |
|
|
|
#pragma warning (pop)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
case audioMasterIdle:
|
|
|
|
if (insideVSTCallback == 0 && MessageManager::getInstance()->isThisTheMessageThread())
|
|
|
|
{
|
|
|
|
@@ -1298,6 +1313,7 @@ public: |
|
|
|
case audioMasterUpdateDisplay: triggerAsyncUpdate(); break;
|
|
|
|
case audioMasterIOChanged: setLatencySamples (effect->initialDelay); break;
|
|
|
|
case audioMasterNeedIdle: startTimer (50); break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case audioMasterGetSampleRate: return (VstIntPtr) (getSampleRate() > 0 ? getSampleRate() : defaultVSTSampleRateValue);
|
|
|
|
case audioMasterGetBlockSize: return (VstIntPtr) (getBlockSize() > 0 ? getBlockSize() : defaultVSTBlockSizeValue);
|
|
|
|
@@ -1383,10 +1399,12 @@ public: |
|
|
|
case audioMasterGetVendorString:
|
|
|
|
case audioMasterGetProductString:
|
|
|
|
{
|
|
|
|
String hostName ("Juce VST Host");
|
|
|
|
String hostName ("Carla");
|
|
|
|
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
if (JUCEApplicationBase* app = JUCEApplicationBase::getInstance())
|
|
|
|
hostName = app->getApplicationName();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
hostName.copyToUTF8 ((char*) ptr, (size_t) jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1);
|
|
|
|
break;
|
|
|
|
@@ -1893,6 +1911,7 @@ private: |
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginInstance)
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
//==============================================================================
|
|
|
|
static Array <VSTPluginWindow*> activeVSTWindows;
|
|
|
|
|
|
|
|
@@ -2616,12 +2635,17 @@ private: |
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginWindow)
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
AudioProcessorEditor* VSTPluginInstance::createEditor()
|
|
|
|
{
|
|
|
|
#ifndef JUCE_PLUGIN_HOST_NO_UI
|
|
|
|
return hasEditor() ? new VSTPluginWindow (*this)
|
|
|
|
: nullptr;
|
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|