|
|
@@ -38,6 +38,14 @@ |
|
|
|
|
|
|
|
#include "juce_audio_basics.h" |
|
|
|
|
|
|
|
#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) |
|
|
|
# include "juce_gui_basics.h" |
|
|
|
#else |
|
|
|
namespace juce { |
|
|
|
# include "juce_events/messages/juce_Initialisation.h" |
|
|
|
} // namespace juce |
|
|
|
#endif |
|
|
|
|
|
|
|
using juce::File; |
|
|
|
using juce::FloatVectorOperations; |
|
|
|
using juce::MemoryOutputStream; |
|
|
@@ -46,6 +54,9 @@ using juce::String; |
|
|
|
using juce::XmlDocument; |
|
|
|
using juce::XmlElement; |
|
|
|
|
|
|
|
static bool gNeedsJuceHandling = false; |
|
|
|
static int gJuceReferenceCounter = 0; |
|
|
|
|
|
|
|
CARLA_BACKEND_START_NAMESPACE |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
@@ -561,6 +572,11 @@ public: |
|
|
|
{ |
|
|
|
carla_debug("CarlaEngineNative::CarlaEngineNative()"); |
|
|
|
|
|
|
|
CARLA_SAFE_ASSERT_INT(gJuceReferenceCounter >= 0, gJuceReferenceCounter); |
|
|
|
|
|
|
|
if (gNeedsJuceHandling && ++gJuceReferenceCounter == 1) |
|
|
|
juce::initialiseJuce_GUI(); |
|
|
|
|
|
|
|
carla_zeroChar(fTmpBuf, STR_MAX+1); |
|
|
|
|
|
|
|
// set-up engine |
|
|
@@ -610,6 +626,9 @@ public: |
|
|
|
|
|
|
|
pData->graph.destroy(); |
|
|
|
|
|
|
|
if (gNeedsJuceHandling && --gJuceReferenceCounter == 0) |
|
|
|
juce::shutdownJuce_GUI(); |
|
|
|
|
|
|
|
carla_debug("CarlaEngineNative::~CarlaEngineNative() - END"); |
|
|
|
} |
|
|
|
|
|
|
@@ -1583,6 +1602,9 @@ CARLA_EXPORT |
|
|
|
const NativePluginDescriptor* carla_get_native_rack_plugin(); |
|
|
|
const NativePluginDescriptor* carla_get_native_rack_plugin() |
|
|
|
{ |
|
|
|
// if this is called then we're running as special plugin |
|
|
|
gNeedsJuceHandling = true; |
|
|
|
|
|
|
|
CARLA_BACKEND_USE_NAMESPACE; |
|
|
|
return &carlaRackDesc; |
|
|
|
} |
|
|
@@ -1591,6 +1613,9 @@ CARLA_EXPORT |
|
|
|
const NativePluginDescriptor* carla_get_native_patchbay_plugin(); |
|
|
|
const NativePluginDescriptor* carla_get_native_patchbay_plugin() |
|
|
|
{ |
|
|
|
// if this is called then we're running as special plugin |
|
|
|
gNeedsJuceHandling = true; |
|
|
|
|
|
|
|
CARLA_BACKEND_USE_NAMESPACE; |
|
|
|
return &carlaPatchbayDesc; |
|
|
|
} |
|
|
|