diff options
author | Patrick Desaulniers <desaulniers.patrick@carrefour.cegepvicto.ca> | 2018-04-26 09:49:48 -0400 |
---|---|---|
committer | Filipe Coelho <falktx@falktx.com> | 2018-04-26 16:49:48 +0300 |
commit | e70a6d2719fc95dc5220e063ae9eb633adb3bede (patch) | |
tree | 4b54acf8ecf78420fa56379bfdfdeaf63df29a78 | |
parent | a50ea2140b3088aba12c8010197eb7e0e80d2b01 (diff) |
Add support for plugins that want midi input but aren't synths (#45)
* Add support for plugins that want midi input and aren't synths
* Check for WANT_MIDI_INPUT instead of IS_SYNTH for process()
-rw-r--r-- | distrho/src/DistrhoPluginCarla.cpp | 2 | ||||
-rw-r--r-- | distrho/src/DistrhoPluginInternal.hpp | 2 | ||||
-rw-r--r-- | distrho/src/DistrhoPluginJack.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/distrho/src/DistrhoPluginCarla.cpp b/distrho/src/DistrhoPluginCarla.cpp index 6f734663..08faff8c 100644 --- a/distrho/src/DistrhoPluginCarla.cpp +++ b/distrho/src/DistrhoPluginCarla.cpp @@ -317,7 +317,7 @@ protected: fPlugin.deactivate(); } -#if DISTRHO_PLUGIN_IS_SYNTH +#if DISTRHO_PLUGIN_WANT_MIDI_INPUT void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override { MidiEvent realMidiEvents[midiEventCount]; 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); |