From 8d0599465a171e91d5952c5b508f08efbb8ab5b4 Mon Sep 17 00:00:00 2001 From: BramGiesen Date: Wed, 23 Dec 2020 18:10:14 +0100 Subject: [PATCH] Renamed variables + indent + small fix --- distrho/DistrhoPlugin.hpp | 8 ++++---- distrho/src/DistrhoPluginLV2.cpp | 14 +++++++------- distrho/src/DistrhoPluginVST.cpp | 2 +- .../src/lv2/control-input-port-change-request.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp index a8a27bce..776e0edb 100644 --- a/distrho/DistrhoPlugin.hpp +++ b/distrho/DistrhoPlugin.hpp @@ -744,10 +744,10 @@ public: #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST - /** - TODO add description - */ - bool requestParameterValueChange(const uint32_t index, const float value) noexcept; + /** + TODO add description + */ + bool requestParameterValueChange(const uint32_t index, const float value) noexcept; #endif protected: /* -------------------------------------------------------------------------------------------------------- diff --git a/distrho/src/DistrhoPluginLV2.cpp b/distrho/src/DistrhoPluginLV2.cpp index d4bb52cd..87f74898 100644 --- a/distrho/src/DistrhoPluginLV2.cpp +++ b/distrho/src/DistrhoPluginLV2.cpp @@ -72,7 +72,7 @@ public: PluginLv2(const double sampleRate, const LV2_URID_Map* const uridMap, const LV2_Worker_Schedule* const worker, - const LV2_ControlInputPort_Change_Request* const parameterRequest, + const LV2_ControlInputPort_Change_Request* const ctrlInPortChangeReq, const bool usingNominal) : fPlugin(this, writeMidiCallback, requestParameterValueChangeCallback), fUsingNominal(usingNominal), @@ -85,7 +85,7 @@ public: fURIDs(uridMap), fUridMap(uridMap), fWorker(worker), - fCtrlInPortChangeReq(parameterRequest) + fCtrlInPortChangeReq(ctrlInPortChangeReq) { #if DISTRHO_PLUGIN_NUM_INPUTS > 0 for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_INPUTS; ++i) @@ -1138,12 +1138,12 @@ private: #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST bool setParameterValueChange(const uint32_t index, const float value) { - return fCtrlInPortChangeReq->request_change(fCtrlInPortChangeReq->handle, index, value); + return fCtrlInPortChangeReq->request_change(fCtrlInPortChangeReq->handle, index, value); } static bool requestParameterValueChangeCallback(void* ptr, const uint32_t index, const float value) { - return ((PluginLv2*)ptr)->setParameterValueChange(index, value); + return (((PluginLv2*)ptr)->setParameterValueChange(index, value) == 0); } #endif }; @@ -1155,7 +1155,7 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons const LV2_Options_Option* options = nullptr; const LV2_URID_Map* uridMap = nullptr; const LV2_Worker_Schedule* worker = nullptr; - const LV2_ControlInputPort_Change_Request* parameterRequest = nullptr; + const LV2_ControlInputPort_Change_Request* ctrlInPortChangeReq = nullptr; for (int i=0; features[i] != nullptr; ++i) { @@ -1166,7 +1166,7 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons else if (std::strcmp(features[i]->URI, LV2_WORKER__schedule) == 0) worker = (const LV2_Worker_Schedule*)features[i]->data; else if (std::strcmp(features[i]->URI, LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI) == 0) - parameterRequest = (const LV2_ControlInputPort_Change_Request*)features[i]->data; + ctrlInPortChangeReq = (const LV2_ControlInputPort_Change_Request*)features[i]->data; } if (options == nullptr) @@ -1231,7 +1231,7 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor*, double sampleRate, cons d_lastSampleRate = sampleRate; - return new PluginLv2(sampleRate, uridMap, worker, parameterRequest, usingNominal); + return new PluginLv2(sampleRate, uridMap, worker, ctrlInPortChangeReq, usingNominal); } #define instancePtr ((PluginLv2*)instance) diff --git a/distrho/src/DistrhoPluginVST.cpp b/distrho/src/DistrhoPluginVST.cpp index 3322d968..00e83170 100644 --- a/distrho/src/DistrhoPluginVST.cpp +++ b/distrho/src/DistrhoPluginVST.cpp @@ -1175,7 +1175,7 @@ private: #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST bool setParameterValueChange(const uint32_t index, const float value) { - return 1; //needs implementation + return 1; //needs implementation } static bool requestParameterValueChangeCallback(void* ptr, const uint32_t index, const float value) diff --git a/distrho/src/lv2/control-input-port-change-request.h b/distrho/src/lv2/control-input-port-change-request.h index a0fc60e5..e38dad45 100644 --- a/distrho/src/lv2/control-input-port-change-request.h +++ b/distrho/src/lv2/control-input-port-change-request.h @@ -23,7 +23,7 @@ #ifndef LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_H #define LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_H -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include "lv2.h" #define LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI "http://kx.studio/ns/lv2ext/control-input-port-change-request" #define LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_PREFIX LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI "#"