@@ -226,8 +226,6 @@ public: | |||
{ | |||
qDebug("BridgePluginClient::BridgePluginClient()"); | |||
hasUI = false; | |||
msgTimerGUI = 0; | |||
msgTimerOSC = 0; | |||
@@ -235,7 +233,9 @@ public: | |||
plugin = nullptr; | |||
pluginGui = nullptr; | |||
m_client = this; | |||
m_client = this; | |||
m_hasUI = false; | |||
m_doQuit = false; | |||
m_needsResize = false; | |||
m_nextSize[0] = 0; | |||
@@ -277,8 +277,10 @@ public: | |||
if (showGui) | |||
{ | |||
if (hasUI) | |||
if (m_hasUI) | |||
show(); | |||
m_doQuit = true; | |||
} | |||
else | |||
{ | |||
@@ -368,7 +370,7 @@ public: | |||
if (! (plugin && pluginGui)) | |||
return; | |||
hasUI = true; | |||
m_hasUI = true; | |||
pluginGui->setResizable(resizable); | |||
pluginGui->setTitle(plugin->name()); | |||
@@ -376,6 +378,11 @@ public: | |||
plugin->setGuiContainer(pluginGui->getContainer()); | |||
} | |||
void enableUI() | |||
{ | |||
m_hasUI = true; | |||
} | |||
// --------------------------------------------------------------------- | |||
// processing | |||
@@ -592,7 +599,12 @@ public: | |||
case CarlaBackend::CALLBACK_SHOW_GUI: | |||
if (value1 == 0) | |||
{ | |||
engine->osc_send_bridge_configure(CarlaBackend::CARLA_BRIDGE_MSG_HIDE_GUI, ""); | |||
if (m_doQuit) | |||
qCloseNow = true; | |||
} | |||
break; | |||
case CarlaBackend::CALLBACK_RESIZE_GUI: | |||
@@ -692,12 +704,13 @@ protected: | |||
// --------------------------------------------------------------------- | |||
private: | |||
bool hasUI; | |||
int msgTimerGUI, msgTimerOSC; | |||
#if 0 | |||
std::set<int32_t> parametersToUpdate; | |||
#endif | |||
bool m_doQuit; | |||
bool m_hasUI; | |||
bool m_needsResize; | |||
int m_nextSize[2]; | |||
@@ -786,8 +799,15 @@ int main(int argc, char* argv[]) | |||
return 2; | |||
} | |||
void* extraStuff = nullptr; | |||
#if 1 // TESTING | |||
static const char* const dssiGUI = "/usr/lib/dssi/amsynth_dssi/amsynth_dssi_gtk"; | |||
extraStuff = (void*)dssiGUI; | |||
#endif | |||
// Init plugin | |||
short id = engine->addPlugin(itype, filename, name, label); | |||
short id = engine->addPlugin(itype, filename, name, label, extraStuff); | |||
int ret; | |||
if (id >= 0 && id < CarlaBackend::MAX_PLUGINS) | |||
@@ -801,9 +821,9 @@ int main(int argc, char* argv[]) | |||
plugin->getGuiInfo(&guiType, &guiResizable); | |||
if (guiType == CarlaBackend::GUI_INTERNAL_QT4 || guiType == CarlaBackend::GUI_INTERNAL_COCOA || guiType == CarlaBackend::GUI_INTERNAL_HWND || guiType == CarlaBackend::GUI_INTERNAL_X11) | |||
{ | |||
client.createWindow(guiResizable); | |||
} | |||
else if (guiType == CarlaBackend::GUI_EXTERNAL_LV2 || guiType == CarlaBackend::GUI_EXTERNAL_OSC) | |||
client.enableUI(); | |||
if (! useOsc) | |||
plugin->setActive(true, false, false); | |||
@@ -364,20 +364,15 @@ void CarlaEngineClient::setLatency(const uint32_t samples) | |||
// Carla Engine Client | |||
CarlaEngine::CarlaEngine() | |||
: m_thread(this), | |||
#ifndef BUILD_BRIDGE | |||
m_osc(this), | |||
#endif | |||
m_oscData(nullptr), | |||
m_callback(nullptr), | |||
: m_osc(this), | |||
m_thread(this) | |||
#ifdef Q_COMPILER_INITIALIZER_LISTS | |||
, | |||
m_callbackPtr(nullptr), | |||
m_carlaPlugins{nullptr}, | |||
m_uniqueNames{nullptr}, | |||
m_insPeak{0.0}, | |||
m_outsPeak{0.0} | |||
#else | |||
m_callbackPtr(nullptr) | |||
#endif | |||
{ | |||
qDebug("CarlaEngine::CarlaEngine()"); | |||
@@ -385,6 +380,10 @@ CarlaEngine::CarlaEngine() | |||
bufferSize = 0; | |||
sampleRate = 0.0; | |||
m_oscData = nullptr; | |||
m_callback = nullptr; | |||
m_callbackPtr = nullptr; | |||
m_aboutToClose = false; | |||
m_maxPluginNumber = 0; | |||
@@ -512,8 +511,9 @@ bool CarlaEngine::init(const char* const clientName) | |||
m_aboutToClose = false; | |||
#ifndef BUILD_BRIDGE | |||
m_osc.init(clientName); | |||
#ifndef BUILD_BRIDGE | |||
m_oscData = m_osc.getControlData(); | |||
if (strcmp(clientName, "Carla") != 0) | |||
@@ -534,10 +534,10 @@ bool CarlaEngine::close() | |||
#ifndef BUILD_BRIDGE | |||
osc_send_control_exit(); | |||
m_osc.close(); | |||
#endif | |||
m_oscData = nullptr; | |||
m_osc.close(); | |||
m_oscData = nullptr; | |||
m_maxPluginNumber = 0; | |||
name.clear(); | |||
@@ -1200,16 +1200,18 @@ void CarlaEngine::midiUnlock() | |||
// ----------------------------------------------------------------------- | |||
// OSC Stuff | |||
bool CarlaEngine::isOscControlRegisted() const | |||
{ | |||
#ifndef BUILD_BRIDGE | |||
bool CarlaEngine::isOscControlRegistered() const | |||
{ | |||
return m_osc.isControlRegistered(); | |||
} | |||
#else | |||
bool CarlaEngine::isOscBridgeRegistered() const | |||
{ | |||
return bool(m_oscData); | |||
#endif | |||
} | |||
#endif | |||
#ifndef BUILD_BRIDGE | |||
bool CarlaEngine::idleOsc() | |||
{ | |||
return m_osc.idle(); | |||
@@ -1224,7 +1226,8 @@ const char* CarlaEngine::getOscServerPathUDP() const | |||
{ | |||
return m_osc.getServerPathUDP(); | |||
} | |||
#else | |||
#ifdef BUILD_BRIDGE | |||
void CarlaEngine::setOscBridgeData(const CarlaOscData* const oscData) | |||
{ | |||
m_oscData = oscData; | |||
@@ -18,20 +18,11 @@ | |||
#ifndef CARLA_ENGINE_HPP | |||
#define CARLA_ENGINE_HPP | |||
#include "carla_engine_osc.hpp" | |||
#include "carla_engine_thread.hpp" | |||
#ifdef BUILD_BRIDGE | |||
# include "carla_osc_utils.hpp" | |||
#else | |||
# include "carla_engine_osc.hpp" | |||
#endif | |||
CARLA_BACKEND_START_NAMESPACE | |||
#ifdef BUILD_BRIDGE | |||
class CarlaPlugin; | |||
#endif | |||
/*! | |||
* @defgroup CarlaBackendEngine Carla Backend Engine | |||
* | |||
@@ -735,41 +726,6 @@ public: | |||
* Set the engine option \a option. | |||
*/ | |||
void setOption(const OptionsType option, const int value, const char* const valueStr); | |||
// ProcessMode processMode() const | |||
// { | |||
// return options.processMode; | |||
// } | |||
// bool processHighPrecision() const | |||
// { | |||
// return options.processHighPrecision; | |||
// } | |||
// uint maxParameters() const | |||
// { | |||
// return options.maxParameters; | |||
// } | |||
// bool forceStereo() const | |||
// { | |||
// return options.forceStereo; | |||
// } | |||
// bool useDssiVstChunks() const | |||
// { | |||
// return options.useDssiVstChunks; | |||
// } | |||
// bool preferUiBridges() const | |||
// { | |||
// return options.preferUiBridges; | |||
// } | |||
// uint oscUiTimeout() const | |||
// { | |||
// return options.oscUiTimeout; | |||
// } | |||
#endif | |||
// ------------------------------------------------------------------- | |||
@@ -798,12 +754,18 @@ public: | |||
// ------------------------------------------------------------------- | |||
// OSC Stuff | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Check if OSC controller is registered. | |||
*/ | |||
bool isOscControlRegisted() const; | |||
bool isOscControlRegistered() const; | |||
#else | |||
/*! | |||
* Check if OSC bridge is registered. | |||
*/ | |||
bool isOscBridgeRegistered() const; | |||
#endif | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Idle OSC. | |||
*/ | |||
@@ -818,7 +780,8 @@ public: | |||
* Get OSC UDP server path. | |||
*/ | |||
const char* getOscServerPathUDP() const; | |||
#else | |||
#ifdef BUILD_BRIDGE | |||
/*! | |||
* Set OSC bridge data. | |||
*/ | |||
@@ -955,10 +918,8 @@ protected: | |||
void bufferSizeChanged(const uint32_t newBufferSize); | |||
private: | |||
CarlaEngineThread m_thread; | |||
#ifndef BUILD_BRIDGE | |||
CarlaEngineOsc m_osc; | |||
#endif | |||
CarlaEngineThread m_thread; | |||
const CarlaOscData* m_oscData; | |||
@@ -40,9 +40,11 @@ CarlaEngineOsc::CarlaEngineOsc(CarlaEngine* const engine_) | |||
m_serverTCP = nullptr; | |||
m_serverUDP = nullptr; | |||
#ifndef BUILD_BRIDGE | |||
m_controlData.path = nullptr; | |||
m_controlData.source = nullptr; | |||
m_controlData.target = nullptr; | |||
#endif | |||
m_name = nullptr; | |||
m_nameSize = 0; | |||
@@ -120,7 +122,9 @@ void CarlaEngineOsc::close() | |||
CARLA_ASSERT(m_serverPathUDP.isNotEmpty()); | |||
CARLA_ASSERT(m_name); | |||
#ifndef BUILD_BRIDGE | |||
m_controlData.free(); | |||
#endif | |||
if (m_serverTCP) | |||
{ | |||
@@ -160,6 +164,7 @@ int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const | |||
if (! path) | |||
return 1; | |||
#ifndef BUILD_BRIDGE | |||
// Initial path check | |||
if (strcmp(path, "/register") == 0) | |||
{ | |||
@@ -170,6 +175,7 @@ int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const | |||
{ | |||
return handleMsgUnregister(); | |||
} | |||
#endif | |||
// Check if message is for this client | |||
if (strlen(path) <= m_nameSize || strncmp(path+1, m_name, m_nameSize) != 0) | |||
@@ -227,6 +233,7 @@ int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const | |||
if (strcmp(method, "/exiting") == 0) | |||
return handleMsgExiting(plugin); | |||
#ifndef BUILD_BRIDGE | |||
// Internal methods | |||
if (strcmp(method, "/set_active") == 0) | |||
return handleMsgSetActive(plugin, argc, argv, types); | |||
@@ -253,14 +260,6 @@ int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const | |||
if (strcmp(method, "/note_off") == 0) | |||
return handleMsgNoteOff(plugin, argc, argv, types); | |||
// Plugin-specific methods | |||
#ifdef WANT_LV2 | |||
if (strcmp(method, "/lv2_atom_transfer") == 0) | |||
return handleMsgLv2AtomTransfer(plugin, argc, argv, types); | |||
if (strcmp(method, "/lv2_event_transfer") == 0) | |||
return handleMsgLv2EventTransfer(plugin, argc, argv, types); | |||
#endif | |||
// Plugin Bridges | |||
if ((plugin->hints() & PLUGIN_IS_BRIDGE) > 0 && strlen(method) > 12 && strncmp(method, "/bridge_", 8) == 0) | |||
{ | |||
@@ -309,6 +308,15 @@ int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const | |||
if (strcmp(method+8, "error") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeError, argc, argv, types); | |||
} | |||
#endif | |||
// Plugin-specific methods | |||
#ifdef WANT_LV2 | |||
if (strcmp(method, "/lv2_atom_transfer") == 0) | |||
return handleMsgLv2AtomTransfer(plugin, argc, argv, types); | |||
if (strcmp(method, "/lv2_event_transfer") == 0) | |||
return handleMsgLv2EventTransfer(plugin, argc, argv, types); | |||
#endif | |||
qWarning("CarlaEngineOsc::handleMessage() - unsupported OSC method '%s'", method); | |||
return 1; | |||
@@ -316,6 +324,7 @@ int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const | |||
// ----------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
int CarlaEngineOsc::handleMsgRegister(const int argc, const lo_arg* const* const argv, const char* const types, const lo_address source) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgRegister()"); | |||
@@ -369,6 +378,7 @@ int CarlaEngineOsc::handleMsgUnregister() | |||
m_controlData.free(); | |||
return 0; | |||
} | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
@@ -491,6 +501,7 @@ int CarlaEngineOsc::handleMsgExiting(CARLA_ENGINE_OSC_HANDLE_ARGS1) | |||
// ----------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
int CarlaEngineOsc::handleMsgSetActive(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetActive()"); | |||
@@ -590,11 +601,14 @@ int CarlaEngineOsc::handleMsgSetProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
const int32_t index = argv[0]->i; | |||
plugin->setProgram(index, true, false, true, true); | |||
if (index >= 0) | |||
#ifndef BUILD_BRIDGE | |||
// parameters might have changed, send all param values back | |||
if (m_controlData.target && index >= 0) | |||
{ | |||
for (uint32_t i=0; i < plugin->parameterCount(); i++) | |||
engine->osc_send_control_set_parameter_value(plugin->id(), i, plugin->getParameterValue(i)); | |||
} | |||
#endif | |||
return 0; | |||
} | |||
@@ -607,11 +621,14 @@ int CarlaEngineOsc::handleMsgSetMidiProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
const int32_t index = argv[0]->i; | |||
plugin->setMidiProgram(index, true, false, true, true); | |||
if (index >= 0) | |||
#ifndef BUILD_BRIDGE | |||
// parameters might have changed, send all param values back | |||
if (m_controlData.target && index >= 0) | |||
{ | |||
for (uint32_t i=0; i < plugin->parameterCount(); i++) | |||
engine->osc_send_control_set_parameter_value(plugin->id(), i, plugin->getParameterValue(i)); | |||
} | |||
#endif | |||
return 0; | |||
} | |||
@@ -662,5 +679,6 @@ int CarlaEngineOsc::handleMsgBridgeSetOutPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
return 0; | |||
} | |||
#endif | |||
CARLA_BACKEND_END_NAMESPACE |
@@ -18,10 +18,6 @@ | |||
#ifndef CARLA_ENGINE_OSC_HPP | |||
#define CARLA_ENGINE_OSC_HPP | |||
#ifdef BUILD_BRIDGE | |||
# error Bad use of file! This should never be used in bridge builds | |||
#endif | |||
#include "carla_backend.hpp" | |||
#include "carla_osc_utils.hpp" | |||
@@ -69,6 +65,7 @@ public: | |||
// ------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
bool isControlRegistered() const | |||
{ | |||
return bool(m_controlData.target); | |||
@@ -78,6 +75,7 @@ public: | |||
{ | |||
return &m_controlData; | |||
} | |||
#endif | |||
const char* getServerPathTCP() const | |||
{ | |||
@@ -98,7 +96,9 @@ private: | |||
lo_server m_serverUDP; | |||
CarlaString m_serverPathTCP; | |||
CarlaString m_serverPathUDP; | |||
#ifndef BUILD_BRIDGE | |||
CarlaOscData m_controlData; // for carla-control | |||
#endif | |||
char* m_name; | |||
size_t m_nameSize; | |||
@@ -107,8 +107,10 @@ private: | |||
int handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg); | |||
#ifndef BUILD_BRIDGE | |||
int handleMsgRegister(const int argc, const lo_arg* const* const argv, const char* const types, const lo_address source); | |||
int handleMsgUnregister(); | |||
#endif | |||
int handleMsgUpdate(CARLA_ENGINE_OSC_HANDLE_ARGS2, const lo_address source); | |||
int handleMsgConfigure(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
@@ -117,6 +119,7 @@ private: | |||
int handleMsgMidi(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgExiting(CARLA_ENGINE_OSC_HANDLE_ARGS1); | |||
#ifndef BUILD_BRIDGE | |||
int handleMsgSetActive(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetDryWet(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetVolume(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
@@ -130,14 +133,15 @@ private: | |||
int handleMsgNoteOn(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgNoteOff(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgBridgeSetInPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgBridgeSetOutPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
#endif | |||
#ifdef WANT_LV2 | |||
int handleMsgLv2AtomTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgLv2EventTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
#endif | |||
int handleMsgBridgeSetInPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgBridgeSetOutPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
// ------------------------------------------------------------------- | |||
static int osc_message_handler(const char* const path, const char* const types, lo_arg** const argv, const int argc, const lo_message msg, void* const userData) | |||
@@ -71,14 +71,18 @@ void CarlaEngineThread::run() | |||
qDebug("CarlaEngineThread::run()"); | |||
CARLA_ASSERT(engine->isRunning()); | |||
bool oscControlRegisted, usesSingleThread; | |||
bool oscRegisted, usesSingleThread; | |||
unsigned short i; | |||
double value; | |||
while (engine->isRunning() && ! m_stopNow) | |||
{ | |||
const ScopedLocker m(this); | |||
oscControlRegisted = engine->isOscControlRegisted(); | |||
#ifndef BUILD_BRIDGE | |||
oscRegisted = engine->isOscControlRegistered(); | |||
#else | |||
oscRegisted = engine->isOscBridgeRegistered(); | |||
#endif | |||
for (i=0; i < engine->maxPluginNumber(); i++) | |||
{ | |||
@@ -98,7 +102,7 @@ void CarlaEngineThread::run() | |||
if (! usesSingleThread) | |||
plugin->postEventsRun(); | |||
if (oscControlRegisted || ! usesSingleThread) | |||
if (oscRegisted || ! usesSingleThread) | |||
{ | |||
// --------------------------------------------------- | |||
// Update parameter outputs | |||
@@ -114,8 +118,8 @@ void CarlaEngineThread::run() | |||
if (! usesSingleThread) | |||
plugin->uiParameterChange(j, value); | |||
// Update OSC control client | |||
if (oscControlRegisted) | |||
// Update OSC engine client | |||
if (oscRegisted) | |||
{ | |||
#ifdef BUILD_BRIDGE | |||
engine->osc_send_bridge_set_parameter_value(j, value); | |||
@@ -128,7 +132,7 @@ void CarlaEngineThread::run() | |||
// --------------------------------------------------- | |||
// Update OSC control client peaks | |||
if (oscControlRegisted) | |||
if (oscRegisted) | |||
{ | |||
#ifdef BUILD_BRIDGE | |||
engine->osc_send_peaks(plugin); | |||
@@ -139,9 +143,7 @@ void CarlaEngineThread::run() | |||
} | |||
} | |||
#ifndef BUILD_BRIDGE | |||
if (! engine->idleOsc()) | |||
#endif | |||
msleep(50); | |||
} | |||
} | |||
@@ -74,12 +74,11 @@ CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const unsigned short id) | |||
m_latency = 0; | |||
m_latencyBuffers = nullptr; | |||
#ifndef BUILD_BRIDGE | |||
// Extra | |||
osc.data.path = nullptr; | |||
osc.data.source = nullptr; | |||
osc.data.target = nullptr; | |||
osc.thread = nullptr; | |||
#endif | |||
} | |||
CarlaPlugin::~CarlaPlugin() | |||
@@ -908,10 +907,15 @@ void CarlaPlugin::recreateLatencyBuffers() | |||
// ------------------------------------------------------------------- | |||
// OSC stuff | |||
void CarlaPlugin::registerToOscControl() | |||
void CarlaPlugin::registerToOscClient() | |||
{ | |||
if (! x_engine->isOscControlRegisted()) | |||
#ifndef BUILD_BRIDGE | |||
if (! x_engine->isOscControlRegistered()) | |||
return; | |||
#else | |||
if (! x_engine->isOscBridgeRegistered()) | |||
return; | |||
#endif | |||
#ifndef BUILD_BRIDGE | |||
x_engine->osc_send_control_add_plugin_start(m_id, m_name); | |||
@@ -1034,7 +1038,6 @@ void CarlaPlugin::registerToOscControl() | |||
#endif | |||
} | |||
#ifndef BUILD_BRIDGE | |||
void CarlaPlugin::updateOscData(const lo_address source, const char* const url) | |||
{ | |||
// FIXME - remove debug prints later | |||
@@ -1101,7 +1104,11 @@ bool CarlaPlugin::waitForOscGuiShow() | |||
{ | |||
qWarning("CarlaPlugin::waitForOscGuiShow()"); | |||
#ifndef BUILD_BRIDGE | |||
const uint oscUiTimeout = x_engine->getOptions().oscUiTimeout; | |||
#else | |||
const uint oscUiTimeout = 40; | |||
#endif | |||
// wait for UI 'update' call | |||
for (uint i=0; i < oscUiTimeout; i++) | |||
@@ -1119,7 +1126,6 @@ bool CarlaPlugin::waitForOscGuiShow() | |||
qWarning("CarlaPlugin::waitForOscGuiShow() - Timeout while waiting for UI to respond (waited %u msecs)", oscUiTimeout); | |||
return false; | |||
} | |||
#endif | |||
// ------------------------------------------------------------------- | |||
// MIDI events | |||
@@ -23,11 +23,11 @@ | |||
#include "carla_osc_utils.hpp" | |||
#ifdef BUILD_BRIDGE | |||
# include "carla_backend_utils.hpp" | |||
//# include "carla_backend_utils.hpp" | |||
# include "carla_bridge_osc.hpp" | |||
#else | |||
# include "carla_plugin_thread.hpp" | |||
//#else | |||
#endif | |||
#include "carla_plugin_thread.hpp" | |||
// common includes | |||
#include <cmath> | |||
@@ -694,11 +694,10 @@ public: | |||
// OSC stuff | |||
/*! | |||
* Register this plugin to the engine's OSC controller. | |||
* Register this plugin to the engine's OSC client (controller or bridge). | |||
*/ | |||
void registerToOscControl(); | |||
void registerToOscClient(); | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Update the plugin's internal OSC data according to \a source and \a url.\n | |||
* This is used for OSC-GUI bridges. | |||
@@ -715,7 +714,6 @@ public: | |||
* This is a handy function that waits for the GUI to respond and automatically asks it to show itself. | |||
*/ | |||
bool waitForOscGuiShow(); | |||
#endif | |||
// ------------------------------------------------------------------- | |||
// MIDI events | |||
@@ -948,12 +946,10 @@ protected: | |||
// ------------------------------------------------------------------- | |||
// Extra | |||
#ifndef BUILD_BRIDGE | |||
struct { | |||
CarlaOscData data; | |||
CarlaPluginThread* thread; | |||
} osc; | |||
#endif | |||
struct { | |||
QMutex mutex; | |||
@@ -55,7 +55,6 @@ public: | |||
{ | |||
qDebug("DssiPlugin::~DssiPlugin()"); | |||
#ifndef BUILD_BRIDGE | |||
// close UI | |||
if (m_hints & PLUGIN_HAS_GUI) | |||
{ | |||
@@ -64,7 +63,7 @@ public: | |||
if (osc.thread) | |||
{ | |||
// Wait a bit first, try safe quit, then force kill | |||
if (osc.thread->isRunning() && ! osc.thread->wait(x_engine->getOptions().oscUiTimeout * 100)) | |||
if (osc.thread->isRunning() && ! osc.thread->wait(40 * 100)) // x_engine->getOptions().oscUiTimeout | |||
{ | |||
qWarning("Failed to properly stop DSSI GUI thread"); | |||
osc.thread->terminate(); | |||
@@ -73,7 +72,6 @@ public: | |||
delete osc.thread; | |||
} | |||
} | |||
#endif | |||
if (ldescriptor) | |||
{ | |||
@@ -235,10 +233,8 @@ public: | |||
descriptor->configure(handle, key, value); | |||
if (h2) descriptor->configure(h2, key, value); | |||
#ifndef BUILD_BRIDGE | |||
if (sendGui && osc.data.target) | |||
osc_send_configure(&osc.data, key, value); | |||
#endif | |||
if (strcmp(key, "reloadprograms") == 0 || strcmp(key, "load") == 0 || strncmp(key, "patches", 7) == 0) | |||
{ | |||
@@ -302,7 +298,6 @@ public: | |||
// ------------------------------------------------------------------- | |||
// Set gui stuff | |||
#ifndef BUILD_BRIDGE | |||
void showGui(const bool yesNo) | |||
{ | |||
CARLA_ASSERT(osc.thread); | |||
@@ -330,7 +325,6 @@ public: | |||
osc.thread->quit(); | |||
} | |||
} | |||
#endif | |||
// ------------------------------------------------------------------- | |||
// Plugin state | |||
@@ -1445,7 +1439,6 @@ public: | |||
// ------------------------------------------------------------------- | |||
// Post-poned events | |||
#ifndef BUILD_BRIDGE | |||
void uiParameterChange(const uint32_t index, const double value) | |||
{ | |||
CARLA_ASSERT(index < param.count); | |||
@@ -1499,7 +1492,6 @@ public: | |||
midiData[2] = note; | |||
osc_send_midi(&osc.data, midiData); | |||
} | |||
#endif | |||
// ------------------------------------------------------------------- | |||
// Cleanup | |||
@@ -1594,7 +1586,6 @@ public: | |||
// --------------------------------------------------------------- | |||
// gui stuff | |||
#ifndef BUILD_BRIDGE | |||
if (guiFilename) | |||
{ | |||
osc.thread = new CarlaPluginThread(x_engine, this, CarlaPluginThread::PLUGIN_THREAD_DSSI_GUI); | |||
@@ -1602,9 +1593,6 @@ public: | |||
m_hints |= PLUGIN_HAS_GUI; | |||
} | |||
#else | |||
Q_UNUSED(guiFilename); | |||
#endif | |||
return true; | |||
} | |||
@@ -1663,7 +1651,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const initializer& init, const void* const ext | |||
} | |||
# endif | |||
plugin->registerToOscControl(); | |||
plugin->registerToOscClient(); | |||
return plugin; | |||
#else | |||
@@ -1262,7 +1262,7 @@ CarlaPlugin* CarlaPlugin::newLADSPA(const initializer& init, const void* const e | |||
} | |||
# endif | |||
plugin->registerToOscControl(); | |||
plugin->registerToOscClient(); | |||
return plugin; | |||
#else | |||
@@ -4600,7 +4600,6 @@ Lv2Plugin::Ft Lv2Plugin::ft = { nullptr, nullptr, nullptr, nullptr, nullptr, nul | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
int CarlaEngineOsc::handleMsgLv2AtomTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaOsc::handleMsgLv2AtomTransfer()"); | |||
@@ -4642,7 +4641,6 @@ int CarlaEngineOsc::handleMsgLv2EventTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
return 0; | |||
} | |||
#endif | |||
CARLA_BACKEND_END_NAMESPACE | |||
@@ -4687,7 +4685,7 @@ CarlaPlugin* CarlaPlugin::newLV2(const initializer& init) | |||
} | |||
# endif | |||
plugin->registerToOscControl(); | |||
plugin->registerToOscClient(); | |||
plugin->updateUi(); | |||
return plugin; | |||
@@ -2440,7 +2440,7 @@ CarlaPlugin* CarlaPlugin::newVST(const initializer& init) | |||
} | |||
# endif | |||
plugin->registerToOscControl(); | |||
plugin->registerToOscClient(); | |||
return plugin; | |||
#else | |||
@@ -217,7 +217,8 @@ void osc_send_exiting(const CarlaOscData* const oscData) | |||
lo_send(oscData->target, targetPath, ""); | |||
} | |||
} | |||
#else | |||
#endif | |||
static inline | |||
void osc_send_show(const CarlaOscData* const oscData) | |||
{ | |||
@@ -262,7 +263,6 @@ void osc_send_quit(const CarlaOscData* const oscData) | |||
lo_send(oscData->target, targetPath, ""); | |||
} | |||
} | |||
#endif | |||
// ------------------------------------------------------------------------------------------------ | |||