From edf17b97b2d78c5a6f0836c2b263f1fc15286bf2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 21 Jan 2015 04:08:25 +0000 Subject: [PATCH] Accept modguis as real UIs --- source/backend/CarlaUtils.cpp | 2 +- source/backend/plugin/CarlaPluginLV2.cpp | 19 ++++++++++++++++--- source/bridges-ui/CarlaBridgeUI.cpp | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/source/backend/CarlaUtils.cpp b/source/backend/CarlaUtils.cpp index 956bf59e0..9e61a5459 100644 --- a/source/backend/CarlaUtils.cpp +++ b/source/backend/CarlaUtils.cpp @@ -455,7 +455,7 @@ const CarlaCachedPluginInfo* carla_get_cached_plugin_info(CB::PluginType ptype, // features info.hints = 0x0; - if (lilvPlugin.get_uis().size() > 0 /*|| lilvPlugin.get_modgui_resources_directory().as_uri() != nullptr*/) + if (lilvPlugin.get_uis().size() > 0 || lilvPlugin.get_modgui_resources_directory().as_uri() != nullptr) info.hints |= CB::PLUGIN_HAS_CUSTOM_UI; { diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index 76f705562..f7d733206 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -1269,6 +1269,10 @@ public: fPipeServer.writeUiOptionsMessage(pData->engine->getSampleRate(), true, true, fLv2Options.windowTitle, frontendWinId); fPipeServer.writeShowMessage(); +#ifndef BUILD_BRIDGE + if (fUI.rdfDescriptor->Type == LV2_UI_MOD) + pData->tryTransient(); +#endif } else { @@ -4096,6 +4100,9 @@ public: case LV2_UI_OLD_EXTERNAL: bridgeBinary += CARLA_OS_SEP_STR "carla-bridge-lv2-external"; break; + case LV2_UI_MOD: + bridgeBinary += CARLA_OS_SEP_STR "carla-bridge-lv2-modgui"; + break; default: return nullptr; } @@ -5034,8 +5041,8 @@ public: // --------------------------------------------------------------- // find the most appropriate ui - int eQt4, eQt5, eGtk2, eGtk3, eCocoa, eWindows, eX11, eExt, iCocoa, iWindows, iX11, iExt, iFinal; - eQt4 = eQt5 = eGtk2 = eGtk3 = eCocoa = eWindows = eX11 = eExt = iCocoa = iWindows = iX11 = iExt = iFinal = -1; + int eQt4, eQt5, eGtk2, eGtk3, eCocoa, eWindows, eX11, eExt, eMod, iCocoa, iWindows, iX11, iExt, iFinal; + eQt4 = eQt5 = eGtk2 = eGtk3 = eCocoa = eWindows = eX11 = eExt = eMod = iCocoa = iWindows = iX11 = iExt = iFinal = -1; #if defined(BUILD_BRIDGE) const bool preferUiBridges(false); @@ -5090,6 +5097,9 @@ public: eExt = ii; iExt = ii; break; + case LV2_UI_MOD: + eMod = ii; + break; default: break; } @@ -5123,6 +5133,8 @@ public: #endif //else if (eExt >= 0) // TODO // iFinal = eExt; + else if (eMod >= 0) + iFinal = eMod; #ifndef LV2_UIS_ONLY_BRIDGES # ifdef CARLA_OS_MAC else if (iCocoa >= 0) @@ -5216,7 +5228,8 @@ public: const LV2_Property uiType(fUI.rdfDescriptor->Type); - if (iFinal == eQt4 || iFinal == eQt5 || iFinal == eGtk2 || iFinal == eGtk3 || iFinal == eCocoa || iFinal == eWindows || iFinal == eX11 || iFinal == eExt) + if (iFinal == eQt4 || iFinal == eQt5 || iFinal == eGtk2 || iFinal == eGtk3 || + iFinal == eCocoa || iFinal == eWindows || iFinal == eX11 || iFinal == eExt || iFinal == eMod) { // ----------------------------------------------------------- // initialize ui-bridge diff --git a/source/bridges-ui/CarlaBridgeUI.cpp b/source/bridges-ui/CarlaBridgeUI.cpp index 8b64ea1d6..84c4e7daa 100644 --- a/source/bridges-ui/CarlaBridgeUI.cpp +++ b/source/bridges-ui/CarlaBridgeUI.cpp @@ -138,7 +138,7 @@ bool CarlaBridgeUI::msgReceived(const char* const msg) noexcept return true; } - if (std::strcmp(msg, "mprogram") == 0) + if (std::strcmp(msg, "midiprogram") == 0) { uint32_t bank, program;