From f8c8aa23eeaee3f41ae65bbe9cf57a7007c34964 Mon Sep 17 00:00:00 2001 From: Patrick Desaulniers Date: Tue, 24 Apr 2018 20:55:12 -0400 Subject: [PATCH] Add support for plugins that want midi input and aren't synths --- distrho/src/DistrhoPluginInternal.hpp | 2 +- distrho/src/DistrhoPluginJack.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/distrho/src/DistrhoPluginInternal.hpp b/distrho/src/DistrhoPluginInternal.hpp index d9677c14..fcb3304e 100644 --- a/distrho/src/DistrhoPluginInternal.hpp +++ b/distrho/src/DistrhoPluginInternal.hpp @@ -503,7 +503,7 @@ public: } } -#if DISTRHO_PLUGIN_IS_SYNTH +#if DISTRHO_PLUGIN_WANT_MIDI_INPUT void run(const float** const inputs, float** const outputs, const uint32_t frames, const MidiEvent* const midiEvents, const uint32_t midiEventCount) { diff --git a/distrho/src/DistrhoPluginJack.cpp b/distrho/src/DistrhoPluginJack.cpp index b735e7d7..4b1e5d5b 100644 --- a/distrho/src/DistrhoPluginJack.cpp +++ b/distrho/src/DistrhoPluginJack.cpp @@ -332,7 +332,7 @@ protected: if (const uint32_t eventCount = jack_midi_get_event_count(midiBuf)) { -#if DISTRHO_PLUGIN_IS_SYNTH +#if DISTRHO_PLUGIN_WANT_MIDI_INPUT uint32_t midiEventCount = 0; MidiEvent midiEvents[eventCount]; #endif @@ -383,7 +383,7 @@ protected: } #endif -#if DISTRHO_PLUGIN_IS_SYNTH +#if DISTRHO_PLUGIN_WANT_MIDI_INPUT MidiEvent& midiEvent(midiEvents[midiEventCount++]); midiEvent.frame = jevent.time; @@ -396,11 +396,11 @@ protected: #endif } -#if DISTRHO_PLUGIN_IS_SYNTH +#if DISTRHO_PLUGIN_WANT_MIDI_INPUT fPlugin.run(audioIns, audioOuts, nframes, midiEvents, midiEventCount); #endif } -#if DISTRHO_PLUGIN_IS_SYNTH +#if DISTRHO_PLUGIN_WANT_MIDI_INPUT else { fPlugin.run(audioIns, audioOuts, nframes, nullptr, 0);