| @@ -744,6 +744,9 @@ public: | |||||
| #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| /** | |||||
| TODO add description | |||||
| */ | |||||
| bool requestParameterValueChange(const uint32_t index, const float value) noexcept; | bool requestParameterValueChange(const uint32_t index, const float value) noexcept; | ||||
| #endif | #endif | ||||
| protected: | protected: | ||||
| @@ -112,7 +112,7 @@ bool Plugin::writeMidiEvent(const MidiEvent& midiEvent) noexcept | |||||
| #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| bool Plugin::requestParameterValueChange(const uint32_t index, const float value) noexcept | bool Plugin::requestParameterValueChange(const uint32_t index, const float value) noexcept | ||||
| { | { | ||||
| return pData->requestParameterValueChange(index, value); | |||||
| return pData->requestParameterValueChangeCallback(index, value); | |||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -31,7 +31,7 @@ static const writeMidiFunc writeMidiCallback = nullptr; | |||||
| #endif | #endif | ||||
| #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| static const requestParameterValueChangeFunc requestParameterValueChange = nullptr; | |||||
| static const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; | |||||
| #endif | #endif | ||||
| #if DISTRHO_PLUGIN_HAS_UI | #if DISTRHO_PLUGIN_HAS_UI | ||||
| @@ -522,7 +522,7 @@ private: | |||||
| return 1; //TODO needs implementation | return 1; //TODO needs implementation | ||||
| } | } | ||||
| static bool requestParameterValueChange(void* ptr, const uint32_t index, const float value) | |||||
| static bool requestParameterValueChangeCallback(void* ptr, const uint32_t index, const float value) | |||||
| { | { | ||||
| return ((PluginCarla*)ptr)->setParameterValueChange(index, value); | return ((PluginCarla*)ptr)->setParameterValueChange(index, value); | ||||
| } | } | ||||
| @@ -74,7 +74,7 @@ struct Plugin::PrivateData { | |||||
| // Callbacks | // Callbacks | ||||
| void* callbacksPtr; | void* callbacksPtr; | ||||
| writeMidiFunc writeMidiCallbackFunc; | writeMidiFunc writeMidiCallbackFunc; | ||||
| requestParameterValueChangeFunc requestParameterChangeFunc; | |||||
| requestParameterValueChangeFunc requestParameterValueChangeCallbackFunc; | |||||
| uint32_t bufferSize; | uint32_t bufferSize; | ||||
| double sampleRate; | double sampleRate; | ||||
| @@ -101,7 +101,7 @@ struct Plugin::PrivateData { | |||||
| #endif | #endif | ||||
| callbacksPtr(nullptr), | callbacksPtr(nullptr), | ||||
| writeMidiCallbackFunc(nullptr), | writeMidiCallbackFunc(nullptr), | ||||
| requestParameterChangeFunc(nullptr), | |||||
| requestParameterValueChangeCallbackFunc(nullptr), | |||||
| bufferSize(d_lastBufferSize), | bufferSize(d_lastBufferSize), | ||||
| sampleRate(d_lastSampleRate) | sampleRate(d_lastSampleRate) | ||||
| { | { | ||||
| @@ -175,10 +175,10 @@ struct Plugin::PrivateData { | |||||
| #endif | #endif | ||||
| #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| bool requestParameterValueChange(const uint32_t index, const float value) | |||||
| bool requestParameterValueChangeCallback(const uint32_t index, const float value) | |||||
| { | { | ||||
| if (requestParameterChangeFunc != nullptr) | |||||
| return requestParameterChangeFunc(callbacksPtr, index, value); | |||||
| if (requestParameterValueChangeCallbackFunc != nullptr) | |||||
| return requestParameterValueChangeCallbackFunc(callbacksPtr, index, value); | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -191,7 +191,9 @@ struct Plugin::PrivateData { | |||||
| class PluginExporter | class PluginExporter | ||||
| { | { | ||||
| public: | public: | ||||
| PluginExporter(void* const callbacksPtr, const writeMidiFunc writeMidiCall, const requestParameterValueChangeFunc parameterChangeCall) | |||||
| PluginExporter(void* const callbacksPtr, | |||||
| const writeMidiFunc writeMidiCall, | |||||
| const requestParameterValueChangeFunc requestParameterValueChangeCall) | |||||
| : fPlugin(createPlugin()), | : fPlugin(createPlugin()), | ||||
| fData((fPlugin != nullptr) ? fPlugin->pData : nullptr), | fData((fPlugin != nullptr) ? fPlugin->pData : nullptr), | ||||
| fIsActive(false) | fIsActive(false) | ||||
| @@ -228,7 +230,7 @@ public: | |||||
| fData->callbacksPtr = callbacksPtr; | fData->callbacksPtr = callbacksPtr; | ||||
| fData->writeMidiCallbackFunc = writeMidiCall; | fData->writeMidiCallbackFunc = writeMidiCall; | ||||
| fData->requestParameterChangeFunc = parameterChangeCall; | |||||
| fData->requestParameterValueChangeCallbackFunc = requestParameterValueChangeCall; | |||||
| } | } | ||||
| ~PluginExporter() | ~PluginExporter() | ||||
| @@ -42,7 +42,7 @@ static const writeMidiFunc writeMidiCallback = nullptr; | |||||
| #endif | #endif | ||||
| #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| static const requestParameterValueChangeFunc requestParameterValueChange = nullptr; | |||||
| static const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; | |||||
| #endif | #endif | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -103,7 +103,7 @@ class PluginJack | |||||
| { | { | ||||
| public: | public: | ||||
| PluginJack(jack_client_t* const client) | PluginJack(jack_client_t* const client) | ||||
| : fPlugin(this, writeMidiCallback, requestParameterValueChange), | |||||
| : fPlugin(this, writeMidiCallback, requestParameterValueChangeCallback), | |||||
| #if DISTRHO_PLUGIN_HAS_UI | #if DISTRHO_PLUGIN_HAS_UI | ||||
| fUI(this, 0, nullptr, setParameterValueCallback, setStateCallback, nullptr, setSizeCallback, getDesktopScaleFactor(), fPlugin.getInstancePointer()), | fUI(this, 0, nullptr, setParameterValueCallback, setStateCallback, nullptr, setSizeCallback, getDesktopScaleFactor(), fPlugin.getInstancePointer()), | ||||
| #endif | #endif | ||||
| @@ -601,7 +601,7 @@ private: | |||||
| return 1; //needs implementation | return 1; //needs implementation | ||||
| } | } | ||||
| static bool requestParameterValueChange(void* ptr, const uint32_t index, const float value) | |||||
| static bool requestParameterValueChangeCallback(void* ptr, const uint32_t index, const float value) | |||||
| { | { | ||||
| return thisPtr->setParameterValueChange(index, value); | return thisPtr->setParameterValueChange(index, value); | ||||
| } | } | ||||
| @@ -62,15 +62,19 @@ static const writeMidiFunc writeMidiCallback = nullptr; | |||||
| #endif | #endif | ||||
| #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| static const requestParameterValueChangeFunc requestParameterValueChange = nullptr; | |||||
| static const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; | |||||
| #endif | #endif | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| class PluginLv2 | class PluginLv2 | ||||
| { | { | ||||
| public: | 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 bool usingNominal) | |||||
| : fPlugin(this, writeMidiCallback, requestParameterValueChange), | |||||
| PluginLv2(const double sampleRate, | |||||
| const LV2_URID_Map* const uridMap, | |||||
| const LV2_Worker_Schedule* const worker, | |||||
| const LV2_ControlInputPort_Change_Request* const parameterRequest, | |||||
| const bool usingNominal) | |||||
| : fPlugin(this, writeMidiCallback, requestParameterValueChangeCallback), | |||||
| fUsingNominal(usingNominal), | fUsingNominal(usingNominal), | ||||
| #ifdef DISTRHO_PLUGIN_LICENSED_FOR_MOD | #ifdef DISTRHO_PLUGIN_LICENSED_FOR_MOD | ||||
| fRunCount(0), | fRunCount(0), | ||||
| @@ -81,7 +85,7 @@ public: | |||||
| fURIDs(uridMap), | fURIDs(uridMap), | ||||
| fUridMap(uridMap), | fUridMap(uridMap), | ||||
| fWorker(worker), | fWorker(worker), | ||||
| fParamRequest(parameterRequest) | |||||
| fCtrlInPortChangeReq(parameterRequest) | |||||
| { | { | ||||
| #if DISTRHO_PLUGIN_NUM_INPUTS > 0 | #if DISTRHO_PLUGIN_NUM_INPUTS > 0 | ||||
| for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_INPUTS; ++i) | for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_INPUTS; ++i) | ||||
| @@ -1045,7 +1049,7 @@ private: | |||||
| // LV2 features | // LV2 features | ||||
| const LV2_URID_Map* const fUridMap; | const LV2_URID_Map* const fUridMap; | ||||
| const LV2_Worker_Schedule* const fWorker; | const LV2_Worker_Schedule* const fWorker; | ||||
| const LV2_ControlInputPort_Change_Request* const fParamRequest; | |||||
| const LV2_ControlInputPort_Change_Request* const fCtrlInPortChangeReq; | |||||
| #if DISTRHO_PLUGIN_WANT_STATE | #if DISTRHO_PLUGIN_WANT_STATE | ||||
| StringMap fStateMap; | StringMap fStateMap; | ||||
| @@ -1134,10 +1138,10 @@ private: | |||||
| #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| bool setParameterValueChange(const uint32_t index, const float value) | bool setParameterValueChange(const uint32_t index, const float value) | ||||
| { | { | ||||
| return fParamRequest->request_change(fParamRequest->handle, index, value); | |||||
| return fCtrlInPortChangeReq->request_change(fCtrlInPortChangeReq->handle, index, value); | |||||
| } | } | ||||
| static bool requestParameterValueChange(void* ptr, const uint32_t index, const float 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); | ||||
| } | } | ||||
| @@ -68,7 +68,7 @@ static const writeMidiFunc writeMidiCallback = nullptr; | |||||
| #endif | #endif | ||||
| #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST | ||||
| static const requestParameterValueChangeFunc requestParameterValueChange = nullptr; | |||||
| static const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; | |||||
| #endif | #endif | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -389,7 +389,7 @@ class PluginVst : public ParameterCheckHelper | |||||
| { | { | ||||
| public: | public: | ||||
| PluginVst(const audioMasterCallback audioMaster, AEffect* const effect) | PluginVst(const audioMasterCallback audioMaster, AEffect* const effect) | ||||
| : fPlugin(this, writeMidiCallback, requestParameterValueChange), | |||||
| : fPlugin(this, writeMidiCallback, requestParameterValueChangeCallback), | |||||
| fAudioMaster(audioMaster), | fAudioMaster(audioMaster), | ||||
| fEffect(effect) | fEffect(effect) | ||||
| { | { | ||||
| @@ -1178,7 +1178,7 @@ private: | |||||
| return 1; //needs implementation | return 1; //needs implementation | ||||
| } | } | ||||
| static bool requestParameterValueChange(void* ptr, const uint32_t index, const float value) | |||||
| static bool requestParameterValueChangeCallback(void* ptr, const uint32_t index, const float value) | |||||
| { | { | ||||
| return ((PluginVst*)ptr)->setParameterValueChange(index, value); | return ((PluginVst*)ptr)->setParameterValueChange(index, value); | ||||
| } | } | ||||