Browse Source

Make MIDI output actually work

pull/61/head
falkTX 6 years ago
parent
commit
340b8e0c59
3 changed files with 9 additions and 5 deletions
  1. +2
    -3
      distrho/src/DistrhoPlugin.cpp
  2. +6
    -2
      distrho/src/DistrhoPluginInternal.hpp
  3. +1
    -0
      distrho/src/DistrhoPluginJack.cpp

+ 2
- 3
distrho/src/DistrhoPlugin.cpp View File

@@ -102,10 +102,9 @@ void Plugin::setLatency(uint32_t frames) noexcept
#endif

#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
bool Plugin::writeMidiEvent(const MidiEvent& /*midiEvent*/) noexcept
bool Plugin::writeMidiEvent(const MidiEvent& midiEvent) noexcept
{
// TODO
return false;
return pData->writeMidiCallback(midiEvent);
}
#endif



+ 6
- 2
distrho/src/DistrhoPluginInternal.hpp View File

@@ -161,11 +161,15 @@ struct Plugin::PrivateData {
#endif
}

void writeMidiCallback(const MidiEvent& midiEvent)
#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
bool writeMidiCallback(const MidiEvent& midiEvent)
{
if (writeMidiCallbackFunc != nullptr)
writeMidiCallbackFunc(callbacksPtr, midiEvent);
return writeMidiCallbackFunc(callbacksPtr, midiEvent);

return false;
}
#endif
};

// -----------------------------------------------------------------------


+ 1
- 0
distrho/src/DistrhoPluginJack.cpp View File

@@ -345,6 +345,7 @@ protected:

#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
fPortMidiOutBuffer = jack_port_get_buffer(fPortMidiOut, nframes);
jack_midi_clear_buffer(fPortMidiOutBuffer);
#endif

if (const uint32_t eventCount = jack_midi_get_event_count(midiBuf))


Loading…
Cancel
Save