From f96518b87191f55f590f61c0e55c673ba2098be8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 4 Jul 2015 21:17:42 +0200 Subject: [PATCH] carla-vst: Send all the midi out events, even when buffer is full --- source/plugin/carla-vst.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/plugin/carla-vst.cpp b/source/plugin/carla-vst.cpp index 888c4d976..fc0fcb76f 100644 --- a/source/plugin/carla-vst.cpp +++ b/source/plugin/carla-vst.cpp @@ -476,7 +476,13 @@ protected: CARLA_SAFE_ASSERT_RETURN(event->data[0] != 0, false); if (fMidiOutEvents.numEvents >= static_cast(kMaxMidiEvents)) - return false; + { + // send current events + hostCallback(audioMasterProcessEvents, 0, 0, &fMidiOutEvents, 0.0f); + + // clear + fMidiOutEvents.numEvents = 0; + } VstMidiEvent& vstMidiEvent(fMidiOutEvents.mdata[fMidiOutEvents.numEvents++]); @@ -489,7 +495,7 @@ protected: for (; i<4; ++i) vstMidiEvent.midiData[i] = 0; - return false; + return true; } void handleUiParameterChanged(const uint32_t /*index*/, const float /*value*/) const @@ -581,9 +587,7 @@ private: FixedVstEvents() : numEvents(0), - reserved(0), - data(), - mdata() + reserved(0) { for (uint32_t i=0; i