diff --git a/source/backend/CarlaEngine.hpp b/source/backend/CarlaEngine.hpp index 818017568..527af145a 100644 --- a/source/backend/CarlaEngine.hpp +++ b/source/backend/CarlaEngine.hpp @@ -880,6 +880,7 @@ public: * Switch plugins with id @a idA and @a idB. */ bool switchPlugins(const uint idA, const uint idB) noexcept; +#endif /*! * Set a plugin's parameter in drag/touch mode. @@ -889,7 +890,6 @@ public: * @param touch The new state for the parameter */ virtual void touchPluginParameter(const uint id, const uint32_t parameterId, const bool touch) noexcept; -#endif /*! * Get plugin with id @a id. diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index 0e24af6cb..ad9b18f3d 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -877,11 +877,11 @@ bool CarlaEngine::switchPlugins(const uint idA, const uint idB) noexcept return true; } +#endif void CarlaEngine::touchPluginParameter(const uint, const uint32_t, const bool) noexcept { } -#endif CarlaPlugin* CarlaEngine::getPlugin(const uint id) const noexcept { diff --git a/source/backend/engine/CarlaEngineBridge.cpp b/source/backend/engine/CarlaEngineBridge.cpp index c83b4c0fb..8f27f4b8b 100644 --- a/source/backend/engine/CarlaEngineBridge.cpp +++ b/source/backend/engine/CarlaEngineBridge.cpp @@ -256,6 +256,17 @@ public: return "Bridge"; } + void touchPluginParameter(const uint id, const uint32_t parameterId, const bool touch) noexcept override + { + CARLA_SAFE_ASSERT_RETURN(id == 0,); + + const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); + fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerParameterTouch); + fShmNonRtServerControl.writeUInt(parameterId); + fShmNonRtServerControl.writeBool(touch); + fShmNonRtServerControl.commitWrite(); + } + CarlaEngineClient* addClient(CarlaPlugin* const) override { return new CarlaEngineBridgeClient(*this, this); diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index 3eba3ac8a..cc0ac4852 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -333,7 +333,6 @@ public: void touchPluginParameter(const uint id, const uint32_t parameterId, const bool touch) noexcept override { - carla_stdout("engineNative touchPluginParameter %u %u %s", id, parameterId, bool2str(touch)); setParameterTouchFromUI(id, parameterId, touch); } @@ -353,7 +352,6 @@ public: if (pluginId != 0) return; - carla_stdout("engineNative setParameterTouchFromUI %u %u %s", pluginId,index, bool2str(touch)); pHost->ui_parameter_touch(pHost->handle, index, touch); } @@ -1394,8 +1392,6 @@ protected: void uiSetParameterValue(const uint32_t index, const float value) { - carla_stdout("uiSetParameterValue(%d, %f)", index, static_cast(value)); - if (CarlaPlugin* const plugin = _getFirstPlugin()) { if (index < plugin->getParameterCount()) diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index 8a3a81740..6c0003267 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -2079,6 +2079,14 @@ public: } } break; + case kPluginBridgeNonRtServerParameterTouch: { + // uint/index, bool/touch + const uint32_t index = fShmNonRtServerControl.readUInt(); + const bool touch = fShmNonRtServerControl.readBool(); + + pData->engine->touchPluginParameter(pData->id, index, touch); + } break; + case kPluginBridgeNonRtServerDefaultValue: { // uint/index, float/value const uint32_t index = fShmNonRtServerControl.readUInt(); diff --git a/source/backend/plugin/CarlaPluginJack.cpp b/source/backend/plugin/CarlaPluginJack.cpp index 72b4282b5..a14c17c55 100644 --- a/source/backend/plugin/CarlaPluginJack.cpp +++ b/source/backend/plugin/CarlaPluginJack.cpp @@ -1397,6 +1397,7 @@ public: case kPluginBridgeNonRtServerParameterRanges: case kPluginBridgeNonRtServerParameterValue: case kPluginBridgeNonRtServerParameterValue2: + case kPluginBridgeNonRtServerParameterTouch: case kPluginBridgeNonRtServerDefaultValue: case kPluginBridgeNonRtServerCurrentProgram: case kPluginBridgeNonRtServerCurrentMidiProgram: diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index dc8940091..ca769b800 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -5114,7 +5114,7 @@ public: void handleUITouch(const uint32_t rindex, const bool touch) { - carla_stdout("CarlaPluginLV2::handleUITouch(%u, %s)", rindex, bool2str(touch)); + carla_debug("CarlaPluginLV2::handleUITouch(%u, %s)", rindex, bool2str(touch)); uint32_t index = LV2UI_INVALID_PORT_INDEX; diff --git a/source/backend/plugin/CarlaPluginNative.cpp b/source/backend/plugin/CarlaPluginNative.cpp index f7b3a8128..ccad7fa62 100644 --- a/source/backend/plugin/CarlaPluginNative.cpp +++ b/source/backend/plugin/CarlaPluginNative.cpp @@ -2396,7 +2396,6 @@ protected: void handleUiParameterTouch(const uint32_t index, const bool touch) const { - carla_stdout("pluginNative handleUiParameterTouch %u %s", index, bool2str(touch)); pData->engine->touchPluginParameter(pData->id, index, touch); } diff --git a/source/backend/plugin/CarlaPluginVST2.cpp b/source/backend/plugin/CarlaPluginVST2.cpp index 966c6e629..38eb43838 100644 --- a/source/backend/plugin/CarlaPluginVST2.cpp +++ b/source/backend/plugin/CarlaPluginVST2.cpp @@ -2197,14 +2197,12 @@ protected: break; case audioMasterBeginEdit: - CARLA_SAFE_ASSERT_BREAK(index > 0); - carla_stdout("audioMasterBeginEdit %i", index); + CARLA_SAFE_ASSERT_BREAK(index >= 0); pData->engine->touchPluginParameter(pData->id, static_cast(index), true); break; case audioMasterEndEdit: - CARLA_SAFE_ASSERT_BREAK(index > 0); - carla_stdout("audioMasterEndEdit %i", index); + CARLA_SAFE_ASSERT_BREAK(index >= 0); pData->engine->touchPluginParameter(pData->id, static_cast(index), false); break; diff --git a/source/plugin/carla-vst.cpp b/source/plugin/carla-vst.cpp index 01ad5ccf4..9d21d3221 100644 --- a/source/plugin/carla-vst.cpp +++ b/source/plugin/carla-vst.cpp @@ -725,7 +725,6 @@ protected: void handleUiParameterTouch(const uint32_t index, const bool touch) const { - carla_stdout("VST handleUiParameterTouch %u %s", index, bool2str(touch)); hostCallback(touch ? audioMasterBeginEdit : audioMasterEndEdit, static_cast(index)); } diff --git a/source/utils/CarlaBridgeDefines.hpp b/source/utils/CarlaBridgeDefines.hpp index 23271557a..774366f10 100644 --- a/source/utils/CarlaBridgeDefines.hpp +++ b/source/utils/CarlaBridgeDefines.hpp @@ -1,6 +1,6 @@ /* * Carla Bridge definitions - * Copyright (C) 2013-2018 Filipe Coelho + * Copyright (C) 2013-2019 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,7 +20,7 @@ #include "CarlaRingBuffer.hpp" -#define CARLA_PLUGIN_BRIDGE_API_VERSION 5 +#define CARLA_PLUGIN_BRIDGE_API_VERSION 6 // ------------------------------------------------------------------------------------------------------------------- @@ -90,6 +90,7 @@ enum PluginBridgeNonRtServerOpcode { kPluginBridgeNonRtServerParameterRanges, // uint/index, float/def, float/min, float/max, float/step, float/stepSmall, float/stepLarge kPluginBridgeNonRtServerParameterValue, // uint/index, float/value kPluginBridgeNonRtServerParameterValue2, // uint/index, float/value (used for init/output parameters only, don't resend values) + kPluginBridgeNonRtServerParameterTouch, // uint/index, bool/touch kPluginBridgeNonRtServerDefaultValue, // uint/index, float/value kPluginBridgeNonRtServerCurrentProgram, // int/index kPluginBridgeNonRtServerCurrentMidiProgram, // int/index diff --git a/source/utils/CarlaBridgeUtils.hpp b/source/utils/CarlaBridgeUtils.hpp index a4f785b0e..b511057f9 100644 --- a/source/utils/CarlaBridgeUtils.hpp +++ b/source/utils/CarlaBridgeUtils.hpp @@ -1,6 +1,6 @@ /* * Carla Bridge utils - * Copyright (C) 2013-2018 Filipe Coelho + * Copyright (C) 2013-2019 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -163,6 +163,8 @@ const char* PluginBridgeNonRtServerOpcode2str(const PluginBridgeNonRtServerOpcod return "kPluginBridgeNonRtServerParameterValue"; case kPluginBridgeNonRtServerParameterValue2: return "kPluginBridgeNonRtServerParameterValue2"; + case kPluginBridgeNonRtServerParameterTouch: + return "kPluginBridgeNonRtServerParameterTouch"; case kPluginBridgeNonRtServerDefaultValue: return "kPluginBridgeNonRtServerDefaultValue"; case kPluginBridgeNonRtServerCurrentProgram: