Browse Source

Fix LV2 MIDI output

tags/2018-04-16
falkTX 7 years ago
parent
commit
d9ea97dcd9
1 changed files with 15 additions and 11 deletions
  1. +15
    -11
      libs/juce/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp

+ 15
- 11
libs/juce/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp View File

@@ -1609,11 +1609,18 @@ public:
}
#endif

if (! midiEvents.isEmpty())
if (portMidiOut != nullptr)
{
#if JucePlugin_ProducesMidiOutput
if (portMidiOut != nullptr)
const uint32_t capacity = portMidiOut->atom.size;

portMidiOut->atom.size = sizeof(LV2_Atom_Sequence_Body);
portMidiOut->atom.type = uridAtomSequence;
portMidiOut->body.unit = 0;
portMidiOut->body.pad = 0;

if (! midiEvents.isEmpty())
{
#if JucePlugin_ProducesMidiOutput
const uint8* midiEventData;
int midiEventSize, midiEventPosition;
MidiBuffer::Iterator i (midiEvents);
@@ -1621,13 +1628,6 @@ public:
uint32_t size, offset = 0;
LV2_Atom_Event* aev;

const uint32_t capacity = portMidiOut->atom.size;

portMidiOut->atom.size = 0;
portMidiOut->atom.type = uridAtomSequence;
portMidiOut->body.unit = 0;
portMidiOut->body.pad = 0;

while (i.getNextEvent (midiEventData, midiEventSize, midiEventPosition))
{
jassert (midiEventPosition >= 0 && midiEventPosition < (int)sampleCount);
@@ -1645,8 +1645,12 @@ public:
offset += size;
portMidiOut->atom.size += size;
}
}
#endif
midiEvents.clear();
}
}
else if (! midiEvents.isEmpty())
{
midiEvents.clear();
}
}


Loading…
Cancel
Save