From d50d95fe6223babe115191ac437dc67a5aa529e8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 6 Jan 2024 20:43:45 +0100 Subject: [PATCH] Use drag/edit for UI parameter example, cleanup Signed-off-by: falkTX --- distrho/src/DistrhoPluginVST2.cpp | 4 ++-- examples/Parameters/ExampleUIParameters.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp index 849589f20..9559d4c27 100644 --- a/distrho/src/DistrhoPluginVST2.cpp +++ b/distrho/src/DistrhoPluginVST2.cpp @@ -94,10 +94,10 @@ typedef struct _VstTimeInfo { typedef std::map StringMap; #if ! DISTRHO_PLUGIN_WANT_MIDI_OUTPUT -static const writeMidiFunc writeMidiCallback = nullptr; +static constexpr const writeMidiFunc writeMidiCallback = nullptr; #endif #if ! DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST -static const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; +static constexpr const requestParameterValueChangeFunc requestParameterValueChangeCallback = nullptr; #endif // -------------------------------------------------------------------------------------------------------------------- diff --git a/examples/Parameters/ExampleUIParameters.cpp b/examples/Parameters/ExampleUIParameters.cpp index ca44b9066..5b465a20c 100644 --- a/examples/Parameters/ExampleUIParameters.cpp +++ b/examples/Parameters/ExampleUIParameters.cpp @@ -212,7 +212,9 @@ class ExampleUIParameters : public UI fParamGrid[index] = !fParamGrid[index]; // report change to host (and thus plugin) + editParameter(index, true); setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); + editParameter(index, false); // trigger repaint repaint(); @@ -227,7 +229,9 @@ class ExampleUIParameters : public UI // same as before const uint32_t index = 3+i; fParamGrid[index] = !fParamGrid[index]; + editParameter(index, true); setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); + editParameter(index, false); repaint(); break; } @@ -240,7 +244,9 @@ class ExampleUIParameters : public UI // same as before const uint32_t index = 6+i; fParamGrid[index] = !fParamGrid[index]; + editParameter(index, true); setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); + editParameter(index, false); repaint(); break; }