Skip to content

Commit

Permalink
Use drag/edit for UI parameter example, cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Jan 6, 2024
1 parent 915daad commit d50d95f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distrho/src/DistrhoPluginVST2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ typedef struct _VstTimeInfo {
typedef std::map<const String, String> 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

// --------------------------------------------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions examples/Parameters/ExampleUIParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit d50d95f

Please sign in to comment.