Signed-off-by: falkTX <falktx@falktx.com>tags/v2.1-rc1
| @@ -880,6 +880,7 @@ public: | |||||
| * Switch plugins with id @a idA and @a idB. | * Switch plugins with id @a idA and @a idB. | ||||
| */ | */ | ||||
| bool switchPlugins(const uint idA, const uint idB) noexcept; | bool switchPlugins(const uint idA, const uint idB) noexcept; | ||||
| #endif | |||||
| /*! | /*! | ||||
| * Set a plugin's parameter in drag/touch mode. | * Set a plugin's parameter in drag/touch mode. | ||||
| @@ -889,7 +890,6 @@ public: | |||||
| * @param touch The new state for the parameter | * @param touch The new state for the parameter | ||||
| */ | */ | ||||
| virtual void touchPluginParameter(const uint id, const uint32_t parameterId, const bool touch) noexcept; | virtual void touchPluginParameter(const uint id, const uint32_t parameterId, const bool touch) noexcept; | ||||
| #endif | |||||
| /*! | /*! | ||||
| * Get plugin with id @a id. | * Get plugin with id @a id. | ||||
| @@ -877,11 +877,11 @@ bool CarlaEngine::switchPlugins(const uint idA, const uint idB) noexcept | |||||
| return true; | return true; | ||||
| } | } | ||||
| #endif | |||||
| void CarlaEngine::touchPluginParameter(const uint, const uint32_t, const bool) noexcept | void CarlaEngine::touchPluginParameter(const uint, const uint32_t, const bool) noexcept | ||||
| { | { | ||||
| } | } | ||||
| #endif | |||||
| CarlaPlugin* CarlaEngine::getPlugin(const uint id) const noexcept | CarlaPlugin* CarlaEngine::getPlugin(const uint id) const noexcept | ||||
| { | { | ||||
| @@ -256,6 +256,17 @@ public: | |||||
| return "Bridge"; | 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 | CarlaEngineClient* addClient(CarlaPlugin* const) override | ||||
| { | { | ||||
| return new CarlaEngineBridgeClient(*this, this); | return new CarlaEngineBridgeClient(*this, this); | ||||
| @@ -333,7 +333,6 @@ public: | |||||
| void touchPluginParameter(const uint id, const uint32_t parameterId, const bool touch) noexcept override | 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); | setParameterTouchFromUI(id, parameterId, touch); | ||||
| } | } | ||||
| @@ -353,7 +352,6 @@ public: | |||||
| if (pluginId != 0) | if (pluginId != 0) | ||||
| return; | return; | ||||
| carla_stdout("engineNative setParameterTouchFromUI %u %u %s", pluginId,index, bool2str(touch)); | |||||
| pHost->ui_parameter_touch(pHost->handle, index, touch); | pHost->ui_parameter_touch(pHost->handle, index, touch); | ||||
| } | } | ||||
| @@ -1394,8 +1392,6 @@ protected: | |||||
| void uiSetParameterValue(const uint32_t index, const float value) | void uiSetParameterValue(const uint32_t index, const float value) | ||||
| { | { | ||||
| carla_stdout("uiSetParameterValue(%d, %f)", index, static_cast<double>(value)); | |||||
| if (CarlaPlugin* const plugin = _getFirstPlugin()) | if (CarlaPlugin* const plugin = _getFirstPlugin()) | ||||
| { | { | ||||
| if (index < plugin->getParameterCount()) | if (index < plugin->getParameterCount()) | ||||
| @@ -2079,6 +2079,14 @@ public: | |||||
| } | } | ||||
| } break; | } 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: { | case kPluginBridgeNonRtServerDefaultValue: { | ||||
| // uint/index, float/value | // uint/index, float/value | ||||
| const uint32_t index = fShmNonRtServerControl.readUInt(); | const uint32_t index = fShmNonRtServerControl.readUInt(); | ||||
| @@ -1397,6 +1397,7 @@ public: | |||||
| case kPluginBridgeNonRtServerParameterRanges: | case kPluginBridgeNonRtServerParameterRanges: | ||||
| case kPluginBridgeNonRtServerParameterValue: | case kPluginBridgeNonRtServerParameterValue: | ||||
| case kPluginBridgeNonRtServerParameterValue2: | case kPluginBridgeNonRtServerParameterValue2: | ||||
| case kPluginBridgeNonRtServerParameterTouch: | |||||
| case kPluginBridgeNonRtServerDefaultValue: | case kPluginBridgeNonRtServerDefaultValue: | ||||
| case kPluginBridgeNonRtServerCurrentProgram: | case kPluginBridgeNonRtServerCurrentProgram: | ||||
| case kPluginBridgeNonRtServerCurrentMidiProgram: | case kPluginBridgeNonRtServerCurrentMidiProgram: | ||||
| @@ -5114,7 +5114,7 @@ public: | |||||
| void handleUITouch(const uint32_t rindex, const bool touch) | 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; | uint32_t index = LV2UI_INVALID_PORT_INDEX; | ||||
| @@ -2396,7 +2396,6 @@ protected: | |||||
| void handleUiParameterTouch(const uint32_t index, const bool touch) const | 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); | pData->engine->touchPluginParameter(pData->id, index, touch); | ||||
| } | } | ||||
| @@ -2197,14 +2197,12 @@ protected: | |||||
| break; | break; | ||||
| case audioMasterBeginEdit: | 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<uint32_t>(index), true); | pData->engine->touchPluginParameter(pData->id, static_cast<uint32_t>(index), true); | ||||
| break; | break; | ||||
| case audioMasterEndEdit: | 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<uint32_t>(index), false); | pData->engine->touchPluginParameter(pData->id, static_cast<uint32_t>(index), false); | ||||
| break; | break; | ||||
| @@ -725,7 +725,6 @@ protected: | |||||
| void handleUiParameterTouch(const uint32_t index, const bool touch) const | 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<int32_t>(index)); | hostCallback(touch ? audioMasterBeginEdit : audioMasterEndEdit, static_cast<int32_t>(index)); | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Bridge definitions | * Carla Bridge definitions | ||||
| * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2019 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 | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "CarlaRingBuffer.hpp" | #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 | kPluginBridgeNonRtServerParameterRanges, // uint/index, float/def, float/min, float/max, float/step, float/stepSmall, float/stepLarge | ||||
| kPluginBridgeNonRtServerParameterValue, // uint/index, float/value | kPluginBridgeNonRtServerParameterValue, // uint/index, float/value | ||||
| kPluginBridgeNonRtServerParameterValue2, // uint/index, float/value (used for init/output parameters only, don't resend values) | 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 | kPluginBridgeNonRtServerDefaultValue, // uint/index, float/value | ||||
| kPluginBridgeNonRtServerCurrentProgram, // int/index | kPluginBridgeNonRtServerCurrentProgram, // int/index | ||||
| kPluginBridgeNonRtServerCurrentMidiProgram, // int/index | kPluginBridgeNonRtServerCurrentMidiProgram, // int/index | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Bridge utils | * Carla Bridge utils | ||||
| * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2019 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 | ||||
| @@ -163,6 +163,8 @@ const char* PluginBridgeNonRtServerOpcode2str(const PluginBridgeNonRtServerOpcod | |||||
| return "kPluginBridgeNonRtServerParameterValue"; | return "kPluginBridgeNonRtServerParameterValue"; | ||||
| case kPluginBridgeNonRtServerParameterValue2: | case kPluginBridgeNonRtServerParameterValue2: | ||||
| return "kPluginBridgeNonRtServerParameterValue2"; | return "kPluginBridgeNonRtServerParameterValue2"; | ||||
| case kPluginBridgeNonRtServerParameterTouch: | |||||
| return "kPluginBridgeNonRtServerParameterTouch"; | |||||
| case kPluginBridgeNonRtServerDefaultValue: | case kPluginBridgeNonRtServerDefaultValue: | ||||
| return "kPluginBridgeNonRtServerDefaultValue"; | return "kPluginBridgeNonRtServerDefaultValue"; | ||||
| case kPluginBridgeNonRtServerCurrentProgram: | case kPluginBridgeNonRtServerCurrentProgram: | ||||