Browse Source

Cleanup

tags/1.9.7
falkTX 9 years ago
parent
commit
d71f470e20
3 changed files with 19 additions and 18 deletions
  1. +12
    -11
      source/backend/plugin/CarlaPluginDSSI.cpp
  2. +4
    -4
      source/utils/CarlaDssiUtils.cpp
  3. +3
    -3
      source/utils/CarlaDssiUtils.hpp

+ 12
- 11
source/backend/plugin/CarlaPluginDSSI.cpp View File

@@ -99,6 +99,8 @@ public:


void run() void run()
{ {
carla_stdout("DSSI UI thread started");

if (fProcess == nullptr) if (fProcess == nullptr)
{ {
fProcess = new ChildProcess(); fProcess = new ChildProcess();
@@ -107,9 +109,9 @@ public:
{ {
carla_stderr("CarlaThreadDSSI::run() - already running, giving up..."); 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->kill();
fProcess = nullptr; fProcess = nullptr;
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr);
return; return;
} }


@@ -208,19 +210,17 @@ public:
carla_stderr("CarlaThreadDSSIUI::run() - UI crashed while running"); carla_stderr("CarlaThreadDSSIUI::run() - UI crashed while running");
else else
carla_stdout("CarlaThreadDSSIUI::run() - UI closed cleanly"); carla_stdout("CarlaThreadDSSIUI::run() - UI closed cleanly");

kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr);
} }
else else
{ {
fProcess->kill(); fProcess->kill();

carla_stdout("CarlaThreadDSSIUI::run() - GUI timeout"); 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; fProcess = nullptr;
kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, kPlugin->getId(), 0, 0, 0.0f, nullptr);

carla_stdout("DSSI UI thread finished");
} }


private: private:
@@ -236,10 +236,10 @@ private:
bool waitForOscGuiShow() bool waitForOscGuiShow()
{ {
carla_stdout("CarlaThreadDSSIUI::waitForOscGuiShow()"); carla_stdout("CarlaThreadDSSIUI::waitForOscGuiShow()");
uint i=0, oscUiTimeout = kEngine->getOptions().uiBridgesTimeout;
const uint uiBridgesTimeout = kEngine->getOptions().uiBridgesTimeout;


// wait for UI 'update' call // wait for UI 'update' call
for (; i < oscUiTimeout/100; ++i)
for (uint i=0; i < uiBridgesTimeout/100; ++i)
{ {
if (fOscData.target != nullptr) if (fOscData.target != nullptr)
{ {
@@ -248,13 +248,14 @@ private:
return true; return true;
} }


if (fProcess != nullptr && fProcess->isRunning())
if (fProcess != nullptr && fProcess->isRunning() && ! shouldThreadExit())
carla_msleep(100); carla_msleep(100);
else else
return false; 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; return false;
} }


@@ -2411,7 +2412,7 @@ public:
for (uint32_t i=0; i < pData->param.count; ++i) for (uint32_t i=0; i < pData->param.count; ++i)
osc_send_control(fOscData, pData->param.data[i].rindex, getParameterValue(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; pData->transientTryCounter = 1;


carla_stdout("CarlaPluginDSSI::updateOscData() - done"); carla_stdout("CarlaPluginDSSI::updateOscData() - done");


+ 4
- 4
source/utils/CarlaDssiUtils.cpp View File

@@ -1,6 +1,6 @@
/* /*
* Carla DSSI utils * 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 * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@@ -19,7 +19,7 @@


#include "juce_core/juce_core.h" #include "juce_core/juce_core.h"


// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------


const char* find_dssi_ui(const char* const filename, const char* const label) noexcept 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; 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 File& gui(results[i]);
const String& guiShortName(gui.getFileName()); 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); } CARLA_SAFE_EXCEPTION_RETURN("find_dssi_ui", nullptr);
} }


// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------

+ 3
- 3
source/utils/CarlaDssiUtils.hpp View File

@@ -1,6 +1,6 @@
/* /*
* Carla DSSI utils * 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 * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@@ -21,11 +21,11 @@
#include "CarlaLadspaUtils.hpp" #include "CarlaLadspaUtils.hpp"
#include "dssi/dssi.h" #include "dssi/dssi.h"


// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Find UI binary for a plugin (returned value must be deleted) // 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; const char* find_dssi_ui(const char* const filename, const char* const label) noexcept;


// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------


#endif // CARLA_DSSI_UTILS_HPP_INCLUDED #endif // CARLA_DSSI_UTILS_HPP_INCLUDED

Loading…
Cancel
Save