From a1b4efc2c4d04967c296768c90ac2d3e19b20a1f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 16 Jun 2013 14:54:18 +0100 Subject: [PATCH] Plugin/UI bridges code cleanup --- doc/Carla-TODO | 5 - source/backend/plugin/CarlaPluginGui.cpp | 9 +- source/backend/standalone/Makefile | 1 + source/bridges/CarlaBridgeClient.cpp | 95 +++++---- source/bridges/CarlaBridgeClient.hpp | 66 +++--- source/bridges/CarlaBridgeOsc.cpp | 31 ++- source/bridges/CarlaBridgeOsc.hpp | 9 +- source/bridges/CarlaBridgeToolkit.cpp | 1 - source/bridges/CarlaBridgeToolkit.hpp | 9 - source/bridges/CarlaBridgeToolkitGtk.cpp | 8 +- source/bridges/CarlaBridgeToolkitQt.cpp | 249 ++++++++++++----------- source/bridges/CarlaBridgeUI-LV2.cpp | 10 +- source/bridges/Makefile | 128 +++++++----- 13 files changed, 320 insertions(+), 301 deletions(-) diff --git a/doc/Carla-TODO b/doc/Carla-TODO index 456ed8360..8448fab9d 100644 --- a/doc/Carla-TODO +++ b/doc/Carla-TODO @@ -1,11 +1,7 @@ # Carla TODO -MAKEFILE: - - "strip" usage - GENERAL: - add direct program access on ui-dialogs (needed for standalone bridges), maybe add extra buttons too (reset plugin, fix ui size) - - implement osc-based uis in bridge mode - implement midi-learn (new dialog) - implement midi-cc automation special rules (invert, half, logarithmic, etc) - allow to change position of plugins (up/down) @@ -28,7 +24,6 @@ LADSPA: DSSI: LV2: - - complete lv2-atom messages support - complete lv2-worker support VST: diff --git a/source/backend/plugin/CarlaPluginGui.cpp b/source/backend/plugin/CarlaPluginGui.cpp index 234b2ad06..5b9441752 100644 --- a/source/backend/plugin/CarlaPluginGui.cpp +++ b/source/backend/plugin/CarlaPluginGui.cpp @@ -74,11 +74,16 @@ CarlaPluginGui::~CarlaPluginGui() if (fOptions.parented) { CARLA_ASSERT(fContainer != nullptr); + + if (fContainer != nullptr) + { #ifdef Q_WS_X11 - delete (QX11EmbedContainer*)fContainer; + delete (QX11EmbedContainer*)fContainer; #else - delete fContainer; + delete fContainer; #endif + fContainer = nullptr; + } } } diff --git a/source/backend/standalone/Makefile b/source/backend/standalone/Makefile index 17ce18ce2..a7861c174 100644 --- a/source/backend/standalone/Makefile +++ b/source/backend/standalone/Makefile @@ -21,6 +21,7 @@ endif # Common LINK_FLAGS += $(shell pkg-config --libs liblo) +LINK_FLAGS += -lpthread ifeq ($(HAVE_QT4),true) LINK_FLAGS += $(shell pkg-config --libs QtCore QtGui QtXml) diff --git a/source/bridges/CarlaBridgeClient.cpp b/source/bridges/CarlaBridgeClient.cpp index 31101cbcd..b7757777c 100644 --- a/source/bridges/CarlaBridgeClient.cpp +++ b/source/bridges/CarlaBridgeClient.cpp @@ -18,7 +18,6 @@ #include "CarlaBridgeClient.hpp" #ifdef BUILD_BRIDGE_UI -# include "CarlaBridgeToolkit.hpp" # include "CarlaLibUtils.hpp" #endif @@ -54,16 +53,9 @@ bool CarlaBridgeClient::uiInit(const char* const, const char* const) { carla_debug("CarlaBridgeClient::uiInit()"); - // Test for single init - { - static bool initiated = false; - CARLA_ASSERT(! initiated); - initiated = true; - } - fUI.init(); - return false; + return true; } void CarlaBridgeClient::uiClose() @@ -75,6 +67,44 @@ void CarlaBridgeClient::uiClose() fUI.close(); } + +// --------------------------------------------------------------------- +// ui toolkit + +void CarlaBridgeClient::toolkitShow() +{ + carla_debug("CarlaBridgeClient::toolkitShow()"); + + fUI.toolkit->show(); +} + +void CarlaBridgeClient::toolkitHide() +{ + carla_debug("CarlaBridgeClient::toolkitHide()"); + + fUI.toolkit->hide(); +} + +void CarlaBridgeClient::toolkitResize(const int width, const int height) +{ + carla_debug("CarlaBridgeClient::toolkitResize(%i, %i)", width, height); + + fUI.toolkit->resize(width, height); +} + +void CarlaBridgeClient::toolkitExec(const bool showGui) +{ + carla_debug("CarlaBridgeClient::toolkitExec(%s)", bool2str(showGui)); + + fUI.toolkit->exec(showGui); +} + +void CarlaBridgeClient::toolkitQuit() +{ + carla_debug("CarlaBridgeClient::toolkitQuit()"); + + fUI.close(); +} #endif // --------------------------------------------------------------------- @@ -82,6 +112,7 @@ void CarlaBridgeClient::uiClose() void CarlaBridgeClient::oscInit(const char* const url) { + CARLA_ASSERT(fOscData == nullptr); carla_debug("CarlaBridgeClient::oscInit(\"%s\")", url); kOsc.init(url); @@ -144,46 +175,6 @@ void CarlaBridgeClient::sendOscBridgeError(const char* const error) } #endif -#ifdef BUILD_BRIDGE_UI -// --------------------------------------------------------------------- -// toolkit - -void CarlaBridgeClient::toolkitShow() -{ - carla_debug("CarlaBridgeClient::toolkitShow()"); - - fUI.toolkit->show(); -} - -void CarlaBridgeClient::toolkitHide() -{ - carla_debug("CarlaBridgeClient::toolkitHide()"); - - fUI.toolkit->hide(); -} - -void CarlaBridgeClient::toolkitResize(const int width, const int height) -{ - carla_debug("CarlaBridgeClient::toolkitResize(%i, %i)", width, height); - - fUI.toolkit->resize(width, height); -} - -void CarlaBridgeClient::toolkitExec(const bool showGui) -{ - carla_debug("CarlaBridgeClient::toolkitExec(%s)", bool2str(showGui)); - - fUI.toolkit->exec(showGui); -} - -void CarlaBridgeClient::toolkitQuit() -{ - carla_debug("CarlaBridgeClient::toolkitQuit()"); - - fUI.close(); -} -#endif - // --------------------------------------------------------------------- void CarlaBridgeClient::sendOscConfigure(const char* const key, const char* const value) @@ -265,6 +256,7 @@ void CarlaBridgeClient::sendOscLv2UridMap(const uint32_t urid, const char* const #ifdef BUILD_BRIDGE_UI void* CarlaBridgeClient::getContainerId() { + carla_debug("CarlaBridgeClient::getContainerId()"); return fUI.toolkit->getContainerId(); } @@ -272,6 +264,7 @@ bool CarlaBridgeClient::uiLibOpen(const char* const filename) { CARLA_ASSERT(fUI.lib == nullptr); CARLA_ASSERT(filename != nullptr); + carla_debug("CarlaBridgeClient::uiLibOpen(\"%s\")", filename); fUI.lib = lib_open(filename); fUI.filename = filename; @@ -282,6 +275,7 @@ bool CarlaBridgeClient::uiLibOpen(const char* const filename) bool CarlaBridgeClient::uiLibClose() { CARLA_ASSERT(fUI.lib != nullptr); + carla_debug("CarlaBridgeClient::uiLibClose()"); if (fUI.lib == nullptr) return false; @@ -294,6 +288,7 @@ bool CarlaBridgeClient::uiLibClose() void* CarlaBridgeClient::uiLibSymbol(const char* const symbol) { CARLA_ASSERT(fUI.lib != nullptr); + carla_debug("CarlaBridgeClient::uiLibSymbol(\"%s\")", symbol); if (fUI.lib == nullptr) return nullptr; @@ -303,6 +298,8 @@ void* CarlaBridgeClient::uiLibSymbol(const char* const symbol) const char* CarlaBridgeClient::uiLibError() { + carla_debug("CarlaBridgeClient::uiLibError()"); + return lib_error(fUI.filename); } #endif diff --git a/source/bridges/CarlaBridgeClient.hpp b/source/bridges/CarlaBridgeClient.hpp index 6ce49b6be..94e45211c 100644 --- a/source/bridges/CarlaBridgeClient.hpp +++ b/source/bridges/CarlaBridgeClient.hpp @@ -19,7 +19,10 @@ #define __CARLA_BRIDGE_CLIENT_HPP__ #include "CarlaBridgeOsc.hpp" -#include "CarlaBridgeToolkit.hpp" + +#ifdef BUILD_BRIDGE_UI +# include "CarlaBridgeToolkit.hpp" +#endif CARLA_BRIDGE_START_NAMESPACE @@ -27,13 +30,6 @@ CARLA_BRIDGE_START_NAMESPACE } // Fix editor indentation #endif -/*! - * @defgroup CarlaBridgeClient Carla Bridge Client - * - * The Carla Bridge Client. - * @{ - */ - class CarlaBridgeClient { public: @@ -53,6 +49,24 @@ public: virtual void* getWidget() const = 0; virtual bool isResizable() const = 0; virtual bool needsReparent() const = 0; + + // --------------------------------------------------------------------- + // ui processing + + virtual void setParameter(const int32_t rindex, const float value) = 0; + virtual void setProgram(const uint32_t index) = 0; + virtual void setMidiProgram(const uint32_t bank, const uint32_t program) = 0; + virtual void noteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) = 0; + virtual void noteOff(const uint8_t channel, const uint8_t note) = 0; + + // --------------------------------------------------------------------- + // ui toolkit + + void toolkitShow(); + void toolkitHide(); + void toolkitResize(const int width, const int height); + void toolkitExec(const bool showGui); + void toolkitQuit(); #endif #ifdef BUILD_BRIDGE_PLUGIN @@ -64,18 +78,6 @@ public: virtual void setChunkData(const char* const filePath) = 0; #endif - // --------------------------------------------------------------------- - // processing - - virtual void setParameter(const int32_t rindex, const float value) = 0; - -#ifndef BUILD_BRIDGE_PLUGIN - virtual void setProgram(const uint32_t index) = 0; - virtual void setMidiProgram(const uint32_t bank, const uint32_t program) = 0; - virtual void noteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) = 0; - virtual void noteOff(const uint8_t channel, const uint8_t note) = 0; -#endif - // --------------------------------------------------------------------- // osc stuff @@ -91,17 +93,6 @@ public: void sendOscBridgeError(const char* const error); #endif -#ifdef BUILD_BRIDGE_UI - // --------------------------------------------------------------------- - // toolkit - - void toolkitShow(); - void toolkitHide(); - void toolkitResize(const int width, const int height); - void toolkitExec(const bool showGui); - void toolkitQuit(); -#endif - // --------------------------------------------------------------------- protected: @@ -142,7 +133,10 @@ private: UI(CarlaBridgeToolkit* const toolkit_) : toolkit(toolkit_), lib(nullptr), - quit(false) {} + quit(false) + { + CARLA_ASSERT(toolkit != nullptr); + } ~UI() { @@ -161,6 +155,12 @@ private: toolkit->quit(); } +# ifdef CARLA_PROPER_CPP11_SUPPORT + UI() = delete; + UI(UI&) = delete; + UI(const UI&) = delete; +# endif + } fUI; #else friend class CarlaPluginClient; @@ -171,8 +171,6 @@ private: CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaBridgeClient) }; -/**@}*/ - CARLA_BRIDGE_END_NAMESPACE #endif // __CARLA_BRIDGE_CLIENT_HPP__ diff --git a/source/bridges/CarlaBridgeOsc.cpp b/source/bridges/CarlaBridgeOsc.cpp index 6e1517966..982bcb08b 100644 --- a/source/bridges/CarlaBridgeOsc.cpp +++ b/source/bridges/CarlaBridgeOsc.cpp @@ -15,10 +15,8 @@ * For a full copy of the GNU General Public License see the GPL.txt file */ -#include "CarlaBridgeOsc.hpp" #include "CarlaBridgeClient.hpp" #include "CarlaMIDI.h" -#include "CarlaUtils.hpp" CARLA_BRIDGE_START_NAMESPACE @@ -41,6 +39,7 @@ CarlaBridgeOsc::~CarlaBridgeOsc() CARLA_ASSERT(fName.isEmpty()); CARLA_ASSERT(fServerPath.isEmpty()); CARLA_ASSERT(fServer == nullptr); + CARLA_ASSERT(fControlData.source == nullptr); // must never be used carla_debug("CarlaBridgeOsc::~CarlaBridgeOsc()"); } @@ -100,6 +99,7 @@ void CarlaBridgeOsc::close() CARLA_ASSERT(fName.isNotEmpty()); CARLA_ASSERT(fServerPath.isNotEmpty()); CARLA_ASSERT(fServer != nullptr); + CARLA_ASSERT(fControlData.source == nullptr); // must never be used carla_debug("CarlaBridgeOsc::close()"); fName.clear(); @@ -151,8 +151,8 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const } // Get method from path - char method[32] = { 0 }; - std::strncpy(method, path + (nameSize + 2), 31); + char method[32+1] = { '\0' }; + std::strncpy(method, path + (nameSize + 2), 32); if (method[0] == '\0') { @@ -160,19 +160,18 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const return 1; } - // Common OSC methods +#ifdef BUILD_BRIDGE_UI + // Common UI methods if (std::strcmp(method, "configure") == 0) return handleMsgConfigure(argc, argv, types); if (std::strcmp(method, "control") == 0) return handleMsgControl(argc, argv, types); -#ifndef BUILD_BRIDGE_PLUGIN if (std::strcmp(method, "program") == 0) return handleMsgProgram(argc, argv, types); if (std::strcmp(method, "midi-program") == 0) return handleMsgMidiProgram(argc, argv, types); if (std::strcmp(method, "midi") == 0) return handleMsgMidi(argc, argv, types); -#endif if (std::strcmp(method, "sample-rate") == 0) return 0; // unused if (std::strcmp(method, "show") == 0) @@ -182,23 +181,23 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const if (std::strcmp(method, "quit") == 0) return handleMsgQuit(); -#ifdef BRIDGE_LV2 +# ifdef BRIDGE_LV2 // LV2 UI methods if (std::strcmp(method, "lv2_atom_transfer") == 0) return handleMsgLv2AtomTransfer(argc, argv, types); if (std::strcmp(method, "lv2_urid_map") == 0) return handleMsgLv2UridMap(argc, argv, types); +# endif #endif #ifdef BUILD_BRIDGE_PLUGIN // Plugin methods if (std::strcmp(method, "plugin_save_now") == 0) return handleMsgPluginSaveNow(); - // TODO: - //if (std::strcmp(method, "plugin_set_parameter_midi_channel") == 0) - // return handleMsgPluginSetParameterMidiChannel(argv); - //if (std::strcmp(method, "plugin_set_parameter_midi_cc") == 0) - // return handleMsgPluginSetParameterMidiCC(argv); + if (std::strcmp(method, "plugin_set_parameter_midi_channel") == 0) + return handleMsgPluginSetParameterMidiChannel(argv); + if (std::strcmp(method, "plugin_set_parameter_midi_cc") == 0) + return handleMsgPluginSetParameterMidiCC(argv); if (std::strcmp(method, "plugin_set_chunk") == 0) return handleMsgPluginSetChunk(argc, argv, types); if (std::strcmp(method, "plugin_set_custom_data") == 0) @@ -209,6 +208,7 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const return 1; } +#ifdef BUILD_BRIDGE_UI int CarlaBridgeOsc::handleMsgConfigure(CARLA_BRIDGE_OSC_HANDLE_ARGS) { CARLA_ASSERT(kClient != nullptr); @@ -247,7 +247,6 @@ int CarlaBridgeOsc::handleMsgControl(CARLA_BRIDGE_OSC_HANDLE_ARGS) return 0; } -#ifndef BUILD_BRIDGE_PLUGIN int CarlaBridgeOsc::handleMsgProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS) { CARLA_ASSERT(kClient != nullptr); @@ -340,9 +339,7 @@ int CarlaBridgeOsc::handleMsgMidi(CARLA_BRIDGE_OSC_HANDLE_ARGS) return 0; } -#endif -#ifdef BUILD_BRIDGE_UI int CarlaBridgeOsc::handleMsgShow() { CARLA_ASSERT(kClient != nullptr); @@ -381,6 +378,6 @@ int CarlaBridgeOsc::handleMsgQuit() return 0; } -#endif +#endif // BUILD_BRIDGE_UI CARLA_BRIDGE_END_NAMESPACE diff --git a/source/bridges/CarlaBridgeOsc.hpp b/source/bridges/CarlaBridgeOsc.hpp index b7c66d20c..ccfa8a2c5 100644 --- a/source/bridges/CarlaBridgeOsc.hpp +++ b/source/bridges/CarlaBridgeOsc.hpp @@ -19,7 +19,6 @@ #define __CARLA_BRIDGE_OSC_HPP__ #include "CarlaBridge.hpp" -#include "CarlaJuceUtils.hpp" #include "CarlaOscUtils.hpp" #include "CarlaString.hpp" @@ -97,24 +96,26 @@ private: int handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg); +#ifdef BUILD_BRIDGE_UI int handleMsgConfigure(CARLA_BRIDGE_OSC_HANDLE_ARGS); int handleMsgControl(CARLA_BRIDGE_OSC_HANDLE_ARGS); -#ifndef BUILD_BRIDGE_PLUGIN int handleMsgProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS); int handleMsgMidiProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS); int handleMsgMidi(CARLA_BRIDGE_OSC_HANDLE_ARGS); -#endif int handleMsgShow(); int handleMsgHide(); int handleMsgQuit(); -#ifdef BRIDGE_LV2 +# ifdef BRIDGE_LV2 int handleMsgLv2AtomTransfer(CARLA_BRIDGE_OSC_HANDLE_ARGS); int handleMsgLv2UridMap(CARLA_BRIDGE_OSC_HANDLE_ARGS); +# endif #endif #ifdef BUILD_BRIDGE_PLUGIN int handleMsgPluginSaveNow(); + int handleMsgPluginSetParameterMidiChannel(CARLA_BRIDGE_OSC_HANDLE_ARGS); + int handleMsgPluginSetParameterMidiCC(CARLA_BRIDGE_OSC_HANDLE_ARGS); int handleMsgPluginSetChunk(CARLA_BRIDGE_OSC_HANDLE_ARGS); int handleMsgPluginSetCustomData(CARLA_BRIDGE_OSC_HANDLE_ARGS); #endif diff --git a/source/bridges/CarlaBridgeToolkit.cpp b/source/bridges/CarlaBridgeToolkit.cpp index 5b3ff04df..b9ea4c9a2 100644 --- a/source/bridges/CarlaBridgeToolkit.cpp +++ b/source/bridges/CarlaBridgeToolkit.cpp @@ -16,7 +16,6 @@ */ #include "CarlaBridgeToolkit.hpp" -#include "CarlaUtils.hpp" CARLA_BRIDGE_START_NAMESPACE diff --git a/source/bridges/CarlaBridgeToolkit.hpp b/source/bridges/CarlaBridgeToolkit.hpp index 876a96648..b88999c5e 100644 --- a/source/bridges/CarlaBridgeToolkit.hpp +++ b/source/bridges/CarlaBridgeToolkit.hpp @@ -27,13 +27,6 @@ CARLA_BRIDGE_START_NAMESPACE } // Fix editor indentation #endif -/*! - * @defgroup CarlaBridgeToolkit Carla Bridge Toolkit - * - * The Carla Bridge Toolkit. - * @{ - */ - class CarlaBridgeToolkit { public: @@ -59,8 +52,6 @@ protected: CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaBridgeToolkit) }; -/**@}*/ - CARLA_BRIDGE_END_NAMESPACE #endif // __CARLA_BRIDGE_TOOLKIT_HPP__ diff --git a/source/bridges/CarlaBridgeToolkitGtk.cpp b/source/bridges/CarlaBridgeToolkitGtk.cpp index bdd00da18..2c51947a5 100644 --- a/source/bridges/CarlaBridgeToolkitGtk.cpp +++ b/source/bridges/CarlaBridgeToolkitGtk.cpp @@ -38,7 +38,9 @@ static const char* const appName = "Carla-UIs"; #endif static int gargc = 0; -static char** gargv = {}; +static char** gargv = nullptr; + +// QSettings settings("falkTX", appName); // ------------------------------------------------------------------------- @@ -46,8 +48,7 @@ class CarlaToolkitGtk : public CarlaBridgeToolkit { public: CarlaToolkitGtk(CarlaBridgeClient* const client, const char* const uiTitle) - : CarlaBridgeToolkit(client, uiTitle), - settings("falkTX", appName) + : CarlaBridgeToolkit(client, uiTitle) { carla_debug("CarlaToolkitGtk::CarlaToolkitGtk(%p, \"%s\")", client, uiTitle); @@ -182,7 +183,6 @@ public: protected: GtkWidget* window; - QSettings settings; gint lastX, lastY, lastWidth, lastHeight; diff --git a/source/bridges/CarlaBridgeToolkitQt.cpp b/source/bridges/CarlaBridgeToolkitQt.cpp index fe8db24fd..dcf0e2b9e 100644 --- a/source/bridges/CarlaBridgeToolkitQt.cpp +++ b/source/bridges/CarlaBridgeToolkitQt.cpp @@ -17,7 +17,7 @@ #include "CarlaBridgeClient.hpp" #include "CarlaBridgeToolkit.hpp" -//#include "CarlaStyle.hpp" +#include "CarlaStyle.hpp" #include #include @@ -69,56 +69,52 @@ static char* qargv[0] = {}; // ------------------------------------------------------------------------- -class CarlaBridgeToolkitQt: public CarlaBridgeToolkit, - public QObject +class CarlaBridgeToolkitQt: public QObject, + public CarlaBridgeToolkit { + Q_OBJECT + public: CarlaBridgeToolkitQt(CarlaBridgeClient* const client, const char* const uiTitle) - : CarlaBridgeToolkit(client, uiTitle), - QObject(nullptr) + : QObject(nullptr), + CarlaBridgeToolkit(client, uiTitle), + fApp(nullptr), + fWindow(nullptr), +#ifdef BRIDGE_CONTAINER + fEmbedContainer(nullptr), +#endif + fMsgTimer(0) { carla_debug("CarlaBridgeToolkitQt::CarlaBridgeToolkitQt(%p, \"%s\")", client, uiTitle); - app = nullptr; - window = nullptr; - - msgTimer = 0; - - needsResize = false; - nextWidth = 0; - nextHeight = 0; - -#ifdef BRIDGE_CONTAINER - embedContainer = nullptr; -#endif + connect(this, SIGNAL(setSizeSafeSignal(int,int)), SLOT(setSizeSafeSlot(int,int))); } ~CarlaBridgeToolkitQt() override { - CARLA_ASSERT(! app); - CARLA_ASSERT(! window); - CARLA_ASSERT(! msgTimer); + CARLA_ASSERT(fApp == nullptr); + CARLA_ASSERT(fWindow == nullptr); + CARLA_ASSERT(fMsgTimer == 0); carla_debug("CarlaBridgeToolkitQt::~CarlaBridgeToolkitQt()"); } void init() override { - CARLA_ASSERT(! app); - CARLA_ASSERT(! window); - CARLA_ASSERT(! msgTimer); + CARLA_ASSERT(fApp == nullptr); + CARLA_ASSERT(fWindow == nullptr); + CARLA_ASSERT(fMsgTimer == 0); carla_debug("CarlaBridgeToolkitQt::init()"); - app = new QApplication(qargc, qargv); + fApp = new QApplication(qargc, qargv); -#if 0 { QSettings settings("falkTX", "Carla"); if (settings.value("Main/UseProTheme", true).toBool()) { CarlaStyle* const style(new CarlaStyle()); - app->setStyle(style); - style->ready(app); + fApp->setStyle(style); + style->ready(fApp); QString color(settings.value("Main/ProThemeColor", "Black").toString()); @@ -128,229 +124,238 @@ public: style->setColorScheme(CarlaStyle::COLOR_BLACK); } } -#endif - window = new QMainWindow(nullptr); - window->resize(30, 30); - window->hide(); + fWindow = new QMainWindow(nullptr); + fWindow->resize(30, 30); + fWindow->hide(); } void exec(const bool showGui) override { - CARLA_ASSERT(app); - CARLA_ASSERT(window); - CARLA_ASSERT(kClient); + CARLA_ASSERT(kClient != nullptr); + CARLA_ASSERT(fApp != nullptr); + CARLA_ASSERT(fWindow != nullptr); carla_debug("CarlaBridgeToolkitQt::exec(%s)", bool2str(showGui)); #if defined(BRIDGE_QT4) || defined(BRIDGE_QT5) - QWidget* const widget = (QWidget*)kClient->getWidget(); + QWidget* const widget((QWidget*)kClient->getWidget()); - window->setCentralWidget(widget); - window->adjustSize(); + fWindow->setCentralWidget(widget); + fWindow->adjustSize(); - widget->setParent(window); + widget->setParent(fWindow); widget->show(); #endif if (! kClient->isResizable()) { - window->setFixedSize(window->width(), window->height()); + fWindow->setFixedSize(fWindow->width(), fWindow->height()); #ifdef Q_OS_WIN - window->setWindowFlags(window->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); + fWindow->setWindowFlags(fWindow->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); #endif } - window->setWindowTitle(kUiTitle); - { QSettings settings("falkTX", appName); if (settings.contains(QString("%1/pos_x").arg(kUiTitle))) { bool hasX, hasY; - int posX = settings.value(QString("%1/pos_x").arg(kUiTitle), window->x()).toInt(&hasX); - int posY = settings.value(QString("%1/pos_y").arg(kUiTitle), window->y()).toInt(&hasY); + const int posX(settings.value(QString("%1/pos_x").arg(kUiTitle), fWindow->x()).toInt(&hasX)); + const int posY(settings.value(QString("%1/pos_y").arg(kUiTitle), fWindow->y()).toInt(&hasY)); if (hasX && hasY) - window->move(posX, posY); + fWindow->move(posX, posY); if (kClient->isResizable()) { bool hasWidth, hasHeight; - int width = settings.value(QString("%1/width").arg(kUiTitle), window->width()).toInt(&hasWidth); - int height = settings.value(QString("%1/height").arg(kUiTitle), window->height()).toInt(&hasHeight); + const int width(settings.value(QString("%1/width").arg(kUiTitle), fWindow->width()).toInt(&hasWidth)); + const int height(settings.value(QString("%1/height").arg(kUiTitle), fWindow->height()).toInt(&hasHeight)); if (hasWidth && hasHeight) - window->resize(width, height); + fWindow->resize(width, height); } } + + if (settings.value("Engine/UIsAlwaysOnTop", true).toBool()) + fWindow->setWindowFlags(fWindow->windowFlags() | Qt::WindowStaysOnTopHint); } + fWindow->setWindowTitle(kUiTitle); + if (showGui) show(); else kClient->sendOscUpdate(); - // Timer - msgTimer = startTimer(50); + fMsgTimer = startTimer(50); // First idle handleTimeout(); // Main loop - app->exec(); + fApp->exec(); } void quit() override { - CARLA_ASSERT(app); + CARLA_ASSERT(kClient != nullptr); + CARLA_ASSERT(fApp != nullptr); + CARLA_ASSERT(fWindow != nullptr); carla_debug("CarlaBridgeToolkitQt::quit()"); - if (msgTimer != 0) + if (fMsgTimer != 0) { - killTimer(msgTimer); - msgTimer = 0; + killTimer(fMsgTimer); + fMsgTimer = 0; } - if (window != nullptr) + if (fWindow != nullptr) { QSettings settings("falkTX", appName); - settings.setValue(QString("%1/pos_x").arg(kUiTitle), window->x()); - settings.setValue(QString("%1/pos_y").arg(kUiTitle), window->y()); - settings.setValue(QString("%1/width").arg(kUiTitle), window->width()); - settings.setValue(QString("%1/height").arg(kUiTitle), window->height()); + settings.setValue(QString("%1/pos_x").arg(kUiTitle), fWindow->x()); + settings.setValue(QString("%1/pos_y").arg(kUiTitle), fWindow->y()); + settings.setValue(QString("%1/width").arg(kUiTitle), fWindow->width()); + settings.setValue(QString("%1/height").arg(kUiTitle), fWindow->height()); settings.sync(); - window->close(); - } + fWindow->close(); #ifdef BRIDGE_CONTAINER - if (embedContainer != nullptr) - { - embedContainer->close(); + if (fEmbedContainer != nullptr) + { + fEmbedContainer->close(); - delete embedContainer; - embedContainer = nullptr; - } + delete fEmbedContainer; + fEmbedContainer = nullptr; + } #endif - if (window != nullptr) - { - delete window; - window = nullptr; + delete fWindow; + fWindow = nullptr; } - if (app) + if (fApp != nullptr) { - if (! app->closingDown()) - app->quit(); + if (! fApp->closingDown()) + fApp->quit(); - delete app; - app = nullptr; + delete fApp; + fApp = nullptr; } } void show() override { - CARLA_ASSERT(window); + CARLA_ASSERT(fWindow != nullptr); carla_debug("CarlaBridgeToolkitQt::show()"); - if (window) - window->show(); + if (fWindow != nullptr) + fWindow->show(); } void hide() override { - CARLA_ASSERT(window); + CARLA_ASSERT(fWindow != nullptr); carla_debug("CarlaBridgeToolkitQt::hide()"); - if (window) - window->hide(); + if (fWindow != nullptr) + fWindow->hide(); } void resize(const int width, const int height) override { - CARLA_ASSERT(window); + CARLA_ASSERT_INT(width > 0, width); + CARLA_ASSERT_INT(height > 0, height); carla_debug("CarlaBridgeToolkitQt::resize(%i, %i)", width, height); - if (app->thread() != QThread::currentThread()) - { - nextWidth = width; - nextHeight = height; - needsResize = true; + if (width <= 0) + return; + if (height <= 0) return; - } - - if (window) - window->setFixedSize(width, height); -#ifdef BRIDGE_CONTAINER - if (embedContainer) - embedContainer->setFixedSize(width, height); -#endif + emit setSizeSafeSignal(width, height); } #ifdef BRIDGE_CONTAINER void* getContainerId() { - CARLA_ASSERT(window != nullptr); + CARLA_ASSERT(fWindow != nullptr); carla_debug("CarlaBridgeToolkitQt::getContainerId()"); - if (embedContainer == nullptr) + if (fEmbedContainer == nullptr) { - embedContainer = new QEmbedContainer(window); + fEmbedContainer = new QEmbedContainer(fWindow); - window->setCentralWidget(embedContainer); - window->adjustSize(); + fWindow->setCentralWidget(fEmbedContainer); + fWindow->adjustSize(); - embedContainer->setParent(window); - embedContainer->show(); + fEmbedContainer->setParent(fWindow); + fEmbedContainer->show(); } - return (void*)embedContainer->winId(); + return (void*)fEmbedContainer->winId(); } #endif protected: - QApplication* app; - QMainWindow* window; - int msgTimer; - - bool needsResize; - int nextWidth, nextHeight; + QApplication* fApp; + QMainWindow* fWindow; #ifdef BRIDGE_CONTAINER - QEmbedContainer* embedContainer; + QEmbedContainer* fEmbedContainer; #endif + int fMsgTimer; + void handleTimeout() { - if (! kClient) + if (kClient == nullptr) return; - if (needsResize) - { - kClient->toolkitResize(nextWidth, nextHeight); - needsResize = false; - } - if (kClient->isOscControlRegistered() && ! kClient->oscIdle()) { - killTimer(msgTimer); - msgTimer = 0; + killTimer(fMsgTimer); + fMsgTimer = 0; } } private: void timerEvent(QTimerEvent* const event) { - if (event->timerId() == msgTimer) + if (event->timerId() == fMsgTimer) handleTimeout(); QObject::timerEvent(event); } + +signals: + void setSizeSafeSignal(int, int); + +private slots: + void setSizeSafeSlot(int width, int height) + { + CARLA_ASSERT(kClient != nullptr && kClient->isResizable()); + CARLA_ASSERT(fWindow != nullptr); + + if (kClient == nullptr || fWindow == nullptr) + return; + + if (kClient->isResizable()) + fWindow->resize(width, height); + else + fWindow->setFixedSize(width, height); + +#ifdef BRIDGE_CONTAINER + if (fEmbedContainer != nullptr) + fEmbedContainer->setFixedSize(width, height); +#endif + } }; +#include "CarlaBridgeToolkitQt.moc" + // ------------------------------------------------------------------------- CarlaBridgeToolkit* CarlaBridgeToolkit::createNew(CarlaBridgeClient* const client, const char* const uiTitle) diff --git a/source/bridges/CarlaBridgeUI-LV2.cpp b/source/bridges/CarlaBridgeUI-LV2.cpp index 82cb30860..02cb5bce6 100644 --- a/source/bridges/CarlaBridgeUI-LV2.cpp +++ b/source/bridges/CarlaBridgeUI-LV2.cpp @@ -20,9 +20,6 @@ #include "CarlaMIDI.h" #include "RtList.hpp" -// TODO - remove -#include - #include extern "C" { @@ -34,11 +31,14 @@ extern "C" { Lv2WorldClass gLv2World; +// ----------------------------------------------------- + CARLA_BRIDGE_START_NAMESPACE -// ------------------------------------------------------------------------- +#if 0 +} +#endif -// fake values static uint32_t gBufferSize = 1024; static double gSampleRate = 44100.0; diff --git a/source/bridges/Makefile b/source/bridges/Makefile index 01ea886d4..39b98adc4 100644 --- a/source/bridges/Makefile +++ b/source/bridges/Makefile @@ -8,20 +8,18 @@ include ../Makefile.mk # -------------------------------------------------------------- -QT_UI_FLAGS = -I../theme - ifeq ($(HAVE_QT4),true) -QT_UI_FLAGS += $(shell pkg-config --cflags QtGui) -QT_UI_LIBS = $(shell pkg-config --libs QtGui) +QT_UI_FLAGS = $(shell pkg-config --cflags QtGui) +QT_UI_LIBS = $(shell pkg-config --libs QtGui) else -QT_UI_FLAGS += $(shell pkg-config --cflags Qt5Gui Qt5Widgets) -QT_UI_LIBS = $(shell pkg-config --libs Qt5Gui Qt5Widgets) +QT_UI_FLAGS = $(shell pkg-config --cflags Qt5Gui Qt5Widgets) +QT_UI_LIBS = $(shell pkg-config --libs Qt5Gui Qt5Widgets) endif # -------------------------------------------------------------- BUILD_CXX_FLAGS += -DBUILD_BRIDGE -BUILD_CXX_FLAGS += -I. -I../backend -I../includes -I../utils +BUILD_CXX_FLAGS += -I. -I../backend -I../includes -I../utils -I../theme BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo) LINK_FLAGS += $(shell pkg-config --libs liblo) @@ -37,7 +35,7 @@ endif # Plugin bridges BUILD_PLUGIN_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_PLUGIN -BUILD_PLUGIN_FLAGS += -I../backend/engine -I../backend/plugin -I../libs -I../theme +BUILD_PLUGIN_FLAGS += -I../backend/engine -I../backend/plugin -I../libs LINK_PLUGIN_FLAGS = $(LINK_FLAGS) -lpthread ifeq ($(CARLA_PLUGIN_SUPPORT),true) @@ -58,22 +56,22 @@ endif # -------------------------------------------------------------- # Plugin bridges (POSIX) -POSIX_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -POSIX_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32 -L/usr/lib/i386-linux-gnu -POSIX_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -POSIX_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -ldl +POSIX_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) +POSIX_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32 -L/usr/lib/i386-linux-gnu +POSIX_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu +POSIX_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -ldl ifneq ($(MACOS),true) -POSIX_LINK_FLAGS += -lrt +POSIX_LINK_FLAGS += -lrt endif # -------------------------------------------------------------- # Plugin bridges (Windows) -WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORT -DPTW32_STATIC_LIB -I../libs/jackbridge -WIN_32BIT_FLAGS = $(32BIT_FLAGS) -WIN_64BIT_FLAGS = $(64BIT_FLAGS) -WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -mwindows -lwinspool -lole32 -luuid -limm32 -lshell32 -lws2_32 -L../libs +WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORT +WIN_32BIT_FLAGS = $(32BIT_FLAGS) +WIN_64BIT_FLAGS = $(64BIT_FLAGS) +WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -mwindows -lwinspool -lole32 -luuid -limm32 -lshell32 -lws2_32 -L../libs # -------------------------------------------------------------- # Plugin bridges (Native) @@ -85,9 +83,8 @@ DGL_LIBS = -lX11 endif NATIVE_BUILD_FLAGS = $(POSIX_BUILD_FLAGS) -NATIVE_LINK_FLAGS = $(POSIX_LINK_FLAGS) - NATIVE_BUILD_FLAGS += -DWANT_NATIVE +NATIVE_LINK_FLAGS = $(POSIX_LINK_FLAGS) ifeq ($(HAVE_FLUIDSYNTH),true) NATIVE_BUILD_FLAGS += -DWANT_FLUIDSYNTH @@ -134,8 +131,12 @@ endif BUILD_UI_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_UI LINK_UI_FLAGS = $(LINK_FLAGS) -ldl -BUILD_UI_LV2_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_LV2 -BUILD_UI_VST_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_VST +BUILD_UI_LV2_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_LV2 +BUILD_UI_VST_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_VST + +ifeq ($(CARLA_VESTIGE_HEADER),true) +BUILD_UI_VST_FLAGS += -DVESTIGE_HEADER +endif BUILD_UI_LV2_GTK2_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_GTK2 -DBRIDGE_LV2_GTK2 $(shell pkg-config --cflags gtk+-2.0) LINK_UI_LV2_GTK2_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-2.0) @@ -150,7 +151,7 @@ BUILD_UI_LV2_QT5_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT5 -DBRIDGE_LV2_QT5 $ LINK_UI_LV2_QT5_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs Qt5Gui Qt5Widgets) BUILD_UI_LV2_COCOA_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_COCOA -DBRIDGE_LV2_COCOA $(QT_UI_FLAGS) -LINK_UI_LV2_COCOA_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) +LINK_UI_LV2_COCOA_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) BUILD_UI_LV2_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_LV2_HWND $(QT_UI_FLAGS) LINK_UI_LV2_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static @@ -159,7 +160,7 @@ BUILD_UI_LV2_X11_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_X11 -DBRIDGE_LV2_X11 $ LINK_UI_LV2_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) BUILD_UI_VST_COCOA_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_COCOA -DBRIDGE_VST_COCOA $(QT_UI_FLAGS) -LINK_UI_VST_COCOA_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) +LINK_UI_VST_COCOA_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) BUILD_UI_VST_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_VST_HWND $(QT_UI_FLAGS) LINK_UI_VST_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static @@ -167,23 +168,9 @@ LINK_UI_VST_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static BUILD_UI_VST_X11_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_X11 -DBRIDGE_VST_X11 $(QT_UI_FLAGS) LINK_UI_VST_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) -ifeq ($(HAVE_QT4),true) -BUILD_UI_LV2_QT4_FLAGS += -I../theme -LINK_UI_LV2_QT4_FLAGS += ../libs/theme.a -else -BUILD_UI_LV2_QT5_FLAGS += -I../theme -LINK_UI_LV2_QT5_FLAGS += ../libs/theme.a -endif - -ifeq ($(CARLA_VESTIGE_HEADER),true) -BUILD_UI_VST_COCOA_FLAGS += -DVESTIGE_HEADER -BUILD_UI_VST_HWND_FLAGS += -DVESTIGE_HEADER -BUILD_UI_VST_X11_FLAGS += -DVESTIGE_HEADER -endif - # -------------------------------------------------------------- -TARGETS = native +TARGETS = native ifeq ($(CARLA_PLUGIN_SUPPORT),true) ifeq ($(HAVE_GTK2),true) @@ -194,10 +181,11 @@ TARGETS += ui_lv2-gtk3 endif ifeq ($(HAVE_QT4),true) TARGETS += ui_lv2-qt4 -endif +else ifeq ($(HAVE_QT5),true) TARGETS += ui_lv2-qt5 endif +endif TARGETS += ui_lv2-x11 TARGETS += ui_vst-x11 endif @@ -236,6 +224,9 @@ win64: carla-bridge-win64.exe %__vst.o: %.cpp $(CXX) $< $(BUILD_UI_VST_FLAGS) -c -o $@ +CarlaBridgeToolkitQt.moc: CarlaBridgeToolkitQt.cpp + $(MOC) $< -DMOC_PARSING -o $@ + OBJS_UI_LV2_LIBS = \ ../libs/lilv.a \ ../libs/rtmempool.a @@ -273,10 +264,10 @@ OBJS_UI_LV2_QT4 = CarlaBridgeUI-LV2__lv2-qt4.o \ CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \ CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-qt4.o -carla-bridge-lv2-qt4: $(OBJS_UI_LV2_QT4) $(OBJS_UI_LV2_LIBS) +carla-bridge-lv2-qt4: $(OBJS_UI_LV2_QT4) $(OBJS_UI_LV2_LIBS) ../libs/theme.a $(CXX) $^ $(LINK_UI_LV2_QT4_FLAGS) -o $@ $(CMD_STRIP) $@ -%__lv2-qt4.o: %.cpp +%__lv2-qt4.o: %.cpp CarlaBridgeToolkitQt.moc $(CXX) $< $(BUILD_UI_LV2_QT4_FLAGS) -c -o $@ # -------------------------------------------------------------- @@ -286,12 +277,38 @@ OBJS_UI_LV2_QT5 = CarlaBridgeUI-LV2__lv2-qt5.o \ CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \ CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-qt5.o -carla-bridge-lv2-qt5: $(OBJS_UI_LV2_QT5) $(OBJS_UI_LV2_LIBS) +carla-bridge-lv2-qt5: $(OBJS_UI_LV2_QT5) $(OBJS_UI_LV2_LIBS) ../libs/theme.a $(CXX) $^ $(LINK_UI_LV2_QT5_FLAGS) -o $@ $(CMD_STRIP) $@ -%__lv2-qt5.o: %.cpp +%__lv2-qt5.o: %.cpp CarlaBridgeToolkitQt.moc $(CXX) $< $(BUILD_UI_LV2_QT5_FLAGS) -c -o $@ +# -------------------------------------------------------------- +# ui_lv2-cocoa + +OBJS_UI_LV2_COCOA = CarlaBridgeUI-LV2__lv2-cocoa.o \ + CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \ + CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-cocoa.o + +carla-bridge-lv2-cocoa: $(OBJS_UI_LV2_COCOA) $(OBJS_UI_LV2_LIBS) ../libs/theme.a + $(CXX) $^ $(LINK_UI_LV2_COCOA_FLAGS) -o $@ $(CMD_STRIP) $@ + +%__lv2-cocoa.o: %.cpp CarlaBridgeToolkitQt.moc + $(CXX) $< $(BUILD_UI_LV2_COCOA_FLAGS) -c -o $@ + +# -------------------------------------------------------------- +# ui_lv2-hwnd + +OBJS_UI_LV2_HWND = CarlaBridgeUI-LV2__lv2-hwnd.o \ + CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \ + CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-hwnd.o + +carla-bridge-lv2-hwnd.exe: $(OBJS_UI_LV2_HWND) $(OBJS_UI_LV2_LIBS) ../libs/theme.a + $(CXX) $^ $(LINK_UI_LV2_HWND_FLAGS) -o $@ $(CMD_STRIP) $@ + +%__lv2-hwnd.o: %.cpp CarlaBridgeToolkitQt.moc + $(CXX) $< $(BUILD_UI_LV2_HWND_FLAGS) -c -o $@ + # -------------------------------------------------------------- # ui_lv2-x11 @@ -302,9 +319,22 @@ OBJS_UI_LV2_X11 = CarlaBridgeUI-LV2__lv2-x11.o \ carla-bridge-lv2-x11: $(OBJS_UI_LV2_X11) $(OBJS_UI_LV2_LIBS) ../libs/theme.a $(CXX) $^ $(LINK_UI_LV2_X11_FLAGS) -o $@ $(CMD_STRIP) $@ -%__lv2-x11.o: %.cpp +%__lv2-x11.o: %.cpp CarlaBridgeToolkitQt.moc $(CXX) $< $(BUILD_UI_LV2_X11_FLAGS) -c -o $@ +# -------------------------------------------------------------- +# ui_vst-cocoa + +OBJS_UI_VST_COCOA = CarlaBridgeUI-VST__vst-cocoa.o \ + CarlaBridgeClient__vst.o CarlaBridgeOsc__vst.o \ + CarlaBridgeToolkit__vst.o CarlaBridgeToolkitQt__vst-cocoa.o + +carla-bridge-vst-cocoa: $(OBJS_UI_VST_COCOA) ../libs/theme.a + $(CXX) $^ $(LINK_UI_VST_COCOA_FLAGS) -o $@ $(CMD_STRIP) $@ + +%__vst-cocoa.o: %.cpp CarlaBridgeToolkitQt.moc + $(CXX) $< $(BUILD_UI_VST_COCOA_FLAGS) -c -o $@ + # -------------------------------------------------------------- # ui_vst-hwnd @@ -315,7 +345,7 @@ OBJS_UI_VST_HWND = CarlaBridgeUI-VST__vst-hwnd.o \ carla-bridge-vst-hwnd.exe: $(OBJS_UI_VST_HWND) ../libs/theme.a $(CXX) $^ $(LINK_UI_VST_HWND_FLAGS) -o $@ $(CMD_STRIP) $@ -%__vst-hwnd.o: %.cpp +%__vst-hwnd.o: %.cpp CarlaBridgeToolkitQt.moc $(CXX) $< $(BUILD_UI_VST_HWND_FLAGS) -c -o $@ # -------------------------------------------------------------- @@ -328,7 +358,7 @@ OBJS_UI_VST_X11 = CarlaBridgeUI-VST__vst-x11.o \ carla-bridge-vst-x11: $(OBJS_UI_VST_X11) ../libs/theme.a $(CXX) $^ $(LINK_UI_VST_X11_FLAGS) -o $@ $(CMD_STRIP) $@ -%__vst-x11.o: %.cpp +%__vst-x11.o: %.cpp CarlaBridgeToolkitQt.moc $(CXX) $< $(BUILD_UI_VST_X11_FLAGS) -c -o $@ # -------------------------------------------------------------- @@ -583,14 +613,14 @@ doxygen: carla_bridge.doxygen # -------------------------------------------------------------- clean: - rm -f *.o *.dll *.so *.exe + rm -f *.moc *.o *.dll *.dylib *.so *.exe rm -f $(OBJS_NATIVE) rm -f $(OBJS_POSIX32) rm -f $(OBJS_POSIX64) rm -f $(OBJS_WIN32) rm -f $(OBJS_WIN64) - rm -f carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt4 carla-bridge-lv2-qt5 carla-bridge-lv2-x11 - rm -f carla-bridge-vst-x11 + rm -f carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt4 carla-bridge-lv2-qt5 carla-bridge-lv2-cocoa carla-bridge-lv2-x11 + rm -f carla-bridge-vst-cocoa carla-bridge-vst-x11 rm -f carla-bridge-native carla-bridge-posix32 carla-bridge-posix64 # --------------------------------------------------------------