Browse Source

Proper juce lv2 midi out code

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

+ 5
- 1
libs/juce/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp View File

@@ -1496,6 +1496,9 @@ 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;
@@ -1504,7 +1507,7 @@ public:
{
jassert (midiEventPosition >= 0 && midiEventPosition < sampleCount);

if (sizeof(LV2_Atom_Event) + midiEventSize > portMidiOut->atom.size - offset)
if (sizeof(LV2_Atom_Event) + midiEventSize > capacity - offset)
break;

aev = (LV2_Atom_Event*)((char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, portMidiOut) + offset);
@@ -1515,6 +1518,7 @@ public:

size = lv2_atom_pad_size(sizeof(LV2_Atom_Event) + midiEventSize);
offset += size;
portMidiOut->atom.size += size;
}
}
#endif


Loading…
Cancel
Save