Browse Source

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()
pull/46/head
Patrick Desaulniers Filipe Coelho <falktx@falktx.com> 5 years ago
parent
commit
e70a6d2719
3 changed files with 6 additions and 6 deletions
  1. +1
    -1
      distrho/src/DistrhoPluginCarla.cpp
  2. +1
    -1
      distrho/src/DistrhoPluginInternal.hpp
  3. +4
    -4
      distrho/src/DistrhoPluginJack.cpp

+ 1
- 1
distrho/src/DistrhoPluginCarla.cpp View File

@@ -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];


+ 1
- 1
distrho/src/DistrhoPluginInternal.hpp View File

@@ -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)
{


+ 4
- 4
distrho/src/DistrhoPluginJack.cpp View File

@@ -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);


Loading…
Cancel
Save