Skip to content

Commit

Permalink
CLAP: add macro to use MIDI MPE dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrey-xx committed Dec 9, 2023
1 parent 63dfb76 commit a6e9147
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions distrho/DistrhoInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ START_NAMESPACE_DISTRHO
*/
#define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.effect"

/**
Whether the plugin supports and prefers the MIDI MPE dialect for MIDI input and MIDI output in the CLAP format.
*/
#define DISTRHO_PLUGIN_CLAP_DIALECT_MIDI_MPE 0

/** @} */

/* ------------------------------------------------------------------------------------------------------------
Expand Down
14 changes: 10 additions & 4 deletions distrho/src/DistrhoPluginCLAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
# define DPF_CLAP_TIMER_INTERVAL 16 /* ~60 fps */
#endif

#if defined(DISTRHO_PLUGIN_CLAP_DIALECT_MIDI_MPE) && DISTRHO_PLUGIN_CLAP_DIALECT_MIDI_MPE
# define DPF_CLAP_NOTE_DIALECT CLAP_NOTE_DIALECT_MIDI_MPE
#else
# define DPF_CLAP_NOTE_DIALECT CLAP_NOTE_DIALECT_MIDI
#endif

START_NAMESPACE_DISTRHO

// --------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2297,8 +2303,8 @@ static bool CLAP_ABI clap_plugin_note_ports_get(const clap_plugin_t*, uint32_t,
{
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
info->id = 0;
info->supported_dialects = CLAP_NOTE_DIALECT_MIDI;
info->preferred_dialect = CLAP_NOTE_DIALECT_MIDI;
info->supported_dialects = DPF_CLAP_NOTE_DIALECT;
info->preferred_dialect = DPF_CLAP_NOTE_DIALECT;
std::strcpy(info->name, "Event/MIDI Input");
return true;
#endif
Expand All @@ -2307,8 +2313,8 @@ static bool CLAP_ABI clap_plugin_note_ports_get(const clap_plugin_t*, uint32_t,
{
#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
info->id = 0;
info->supported_dialects = CLAP_NOTE_DIALECT_MIDI;
info->preferred_dialect = CLAP_NOTE_DIALECT_MIDI;
info->supported_dialects = DPF_CLAP_NOTE_DIALECT;
info->preferred_dialect = DPF_CLAP_NOTE_DIALECT;
std::strcpy(info->name, "Event/MIDI Output");
return true;
#endif
Expand Down

0 comments on commit a6e9147

Please sign in to comment.