Browse Source

Some corrections to last commit

tags/1.9.4
falkTX 10 years ago
parent
commit
38de778420
2 changed files with 26 additions and 6 deletions
  1. +21
    -5
      source/backend/engine/CarlaEngineBridge.cpp
  2. +5
    -1
      source/bridges-plugin/CarlaBridgePlugin.cpp

+ 21
- 5
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -212,7 +212,8 @@ public:
CarlaEngineBridge(const char* const audioBaseName, const char* const controlBaseName, const char* const timeBaseName)
: CarlaEngine(),
CarlaThread("CarlaEngineBridge"),
fIsRunning(false)
fIsRunning(false),
fNextUIState(-1)
{
carla_stdout("CarlaEngineBridge::CarlaEngineBridge(%s, %s, %s)", audioBaseName, controlBaseName, timeBaseName);

@@ -358,6 +359,20 @@ public:
return "Bridge";
}

void idle() noexcept override
{
CarlaEngine::idle();

if (fNextUIState == -1 || ! fIsRunning)
return;

try {
carla_show_custom_ui(0, bool(fNextUIState));
} CARLA_SAFE_EXCEPTION("bridge show_custom_ui");

fNextUIState = -1;
}

// -------------------------------------
// CarlaThread virtual calls

@@ -589,14 +604,12 @@ public:

case kPluginBridgeOpcodeShowUI:
carla_stdout("-----------------------------------------------------, got SHOW UI");

carla_show_custom_ui(0, true);
fNextUIState = 1;
break;

case kPluginBridgeOpcodeHideUI:
carla_stdout("-----------------------------------------------------, got HIDE UI");

carla_show_custom_ui(0, false);
fNextUIState = 0;
break;

case kPluginBridgeOpcodeQuit:
@@ -615,6 +628,8 @@ public:
}

fIsRunning = false;

callback(ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0.0f, nullptr);
}

private:
@@ -623,6 +638,7 @@ private:
BridgeTime fShmTime;

volatile bool fIsRunning;
volatile int fNextUIState;

CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineBridge)
};


+ 5
- 1
source/bridges-plugin/CarlaBridgePlugin.cpp View File

@@ -228,11 +228,15 @@ public:
std::free(tmpServerPath);
}

lo_server_thread_start(fOscServerThread);

fEngine->setOscBridgeData(&fOscControlData);
}

void oscClose()
{
lo_server_thread_stop(fOscServerThread);

fEngine->setOscBridgeData(nullptr);

if (fOscServerThread != nullptr)
@@ -284,7 +288,7 @@ public:
carla_stderr("Plugin preset load failed, error was:\n%s", carla_get_last_error());
}

gIsInitiated = true;
gIsInitiated = true;

#if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
JUCEApplicationBase::createInstance = &juce_CreateApplication;


Loading…
Cancel
Save