Browse Source

CLAP: add macro to use MIDI MPE dialect (#443)

* CLAP: add macro to use MIDI MPE dialect

* Change MIDI MPE as a generic macro
pull/491/head
Jérémy Frey GitHub 4 months ago
parent
commit
2b3e67af72
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions
  1. +6
    -0
      distrho/DistrhoInfo.hpp
  2. +10
    -4
      distrho/src/DistrhoPluginCLAP.cpp

+ 6
- 0
distrho/DistrhoInfo.hpp View File

@@ -565,6 +565,12 @@ START_NAMESPACE_DISTRHO
*/
#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1

/**
Whether the plugin uses MIDI MPE for MIDI input and MIDI output.
@note Only CLAP implements this macro at the moment
*/
#define DISTRHO_PLUGIN_MIDI_MPE 0

/**
Whether the plugin wants to change its own parameter inputs.@n
Not all hosts or plugin formats support this,


+ 10
- 4
distrho/src/DistrhoPluginCLAP.cpp View File

@@ -67,6 +67,12 @@
# define DPF_CLAP_TIMER_INTERVAL 16 /* ~60 fps */
#endif

#if defined(DISTRHO_PLUGIN_MIDI_MPE) && DISTRHO_PLUGIN_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

// --------------------------------------------------------------------------------------------------------------------
@@ -2286,8 +2292,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
@@ -2296,8 +2302,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


Loading…
Cancel
Save