commit e70a6d2719fc95dc5220e063ae9eb633adb3bede
parent a50ea2140b3088aba12c8010197eb7e0e80d2b01
Author: Patrick Desaulniers <desaulniers.patrick@carrefour.cegepvicto.ca>
Date: Thu, 26 Apr 2018 09:49:21 -0400
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()
Diffstat:
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git 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
@@ -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
@@ -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);