@@ -99,6 +99,8 @@ public: | |||
void run() | |||
{ | |||
carla_stdout("DSSI UI thread started"); | |||
if (fProcess == nullptr) | |||
{ | |||
fProcess = new ChildProcess(); | |||
@@ -107,9 +109,9 @@ public: | |||
{ | |||
carla_stderr("CarlaThreadDSSI::run() - already running, giving up..."); | |||
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr); | |||
fProcess->kill(); | |||
fProcess = nullptr; | |||
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr); | |||
return; | |||
} | |||
@@ -208,19 +210,17 @@ public: | |||
carla_stderr("CarlaThreadDSSIUI::run() - UI crashed while running"); | |||
else | |||
carla_stdout("CarlaThreadDSSIUI::run() - UI closed cleanly"); | |||
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr); | |||
} | |||
else | |||
{ | |||
fProcess->kill(); | |||
carla_stdout("CarlaThreadDSSIUI::run() - GUI timeout"); | |||
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr); | |||
} | |||
carla_stdout("DSSI UI finished"); | |||
fProcess = nullptr; | |||
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr); | |||
carla_stdout("DSSI UI thread finished"); | |||
} | |||
private: | |||
@@ -236,10 +236,10 @@ private: | |||
bool waitForOscGuiShow() | |||
{ | |||
carla_stdout("CarlaThreadDSSIUI::waitForOscGuiShow()"); | |||
uint i=0, oscUiTimeout = kEngine->getOptions().uiBridgesTimeout; | |||
const uint uiBridgesTimeout = kEngine->getOptions().uiBridgesTimeout; | |||
// wait for UI 'update' call | |||
for (; i < oscUiTimeout/100; ++i) | |||
for (uint i=0; i < uiBridgesTimeout/100; ++i) | |||
{ | |||
if (fOscData.target != nullptr) | |||
{ | |||
@@ -248,13 +248,14 @@ private: | |||
return true; | |||
} | |||
if (fProcess != nullptr && fProcess->isRunning()) | |||
if (fProcess != nullptr && fProcess->isRunning() && ! shouldThreadExit()) | |||
carla_msleep(100); | |||
else | |||
return false; | |||
} | |||
carla_stdout("CarlaThreadDSSIUI::waitForOscGuiShow() - Timeout while waiting for UI to respond (waited %u msecs)", oscUiTimeout); | |||
carla_stdout("CarlaThreadDSSIUI::waitForOscGuiShow() - Timeout while waiting for UI to respond" | |||
"(waited %u msecs)", uiBridgesTimeout); | |||
return false; | |||
} | |||
@@ -2411,7 +2412,7 @@ public: | |||
for (uint32_t i=0; i < pData->param.count; ++i) | |||
osc_send_control(fOscData, pData->param.data[i].rindex, getParameterValue(i)); | |||
if ((pData->hints & PLUGIN_HAS_CUSTOM_UI) != 0 && pData->engine->getOptions().frontendWinId != 0) | |||
if (pData->engine->getOptions().frontendWinId != 0) | |||
pData->transientTryCounter = 1; | |||
carla_stdout("CarlaPluginDSSI::updateOscData() - done"); | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
* Carla DSSI utils | |||
* Copyright (C) 2013-2014 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2013-2016 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | |||
@@ -19,7 +19,7 @@ | |||
#include "juce_core/juce_core.h" | |||
// ----------------------------------------------------------------------- | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
const char* find_dssi_ui(const char* const filename, const char* const label) noexcept | |||
{ | |||
@@ -41,7 +41,7 @@ const char* find_dssi_ui(const char* const filename, const char* const label) no | |||
Array<File> results; | |||
for (int i=0, count=File(pluginDir).findChildFiles(results, File::findFiles|File::ignoreHiddenFiles, false); i < count; ++i) | |||
for (int i=File(pluginDir).findChildFiles(results, File::findFiles|File::ignoreHiddenFiles, false); --i >= 0;) | |||
{ | |||
const File& gui(results[i]); | |||
const String& guiShortName(gui.getFileName()); | |||
@@ -61,4 +61,4 @@ const char* find_dssi_ui(const char* const filename, const char* const label) no | |||
} CARLA_SAFE_EXCEPTION_RETURN("find_dssi_ui", nullptr); | |||
} | |||
// ----------------------------------------------------------------------- | |||
// -------------------------------------------------------------------------------------------------------------------- |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Carla DSSI utils | |||
* Copyright (C) 2013-2014 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2013-2016 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | |||
@@ -21,11 +21,11 @@ | |||
#include "CarlaLadspaUtils.hpp" | |||
#include "dssi/dssi.h" | |||
// ----------------------------------------------------------------------- | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
// Find UI binary for a plugin (returned value must be deleted) | |||
const char* find_dssi_ui(const char* const filename, const char* const label) noexcept; | |||
// ----------------------------------------------------------------------- | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#endif // CARLA_DSSI_UTILS_HPP_INCLUDED |