summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-10-27 09:56:07 +0100
committerRobin Gareus <robin@gareus.org>2013-10-27 09:56:07 +0100
commit2cad99bf39348222ef554c5134c7950e49afabb5 (patch)
tree2895e5611f9ea1f35e6bd125e77eb4d3759f9150 /libs
parentbe6d6231fbe56875815c81999e1fc41db0e21a23 (diff)
add notes about inlined lv2 atom/util.h functions
Diffstat (limited to 'libs')
-rw-r--r--libs/plugins/reasonablesynth.lv2/lv2.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/plugins/reasonablesynth.lv2/lv2.c b/libs/plugins/reasonablesynth.lv2/lv2.c
index ce3f5c16f5..1fcfba868e 100644
--- a/libs/plugins/reasonablesynth.lv2/lv2.c
+++ b/libs/plugins/reasonablesynth.lv2/lv2.c
@@ -134,8 +134,11 @@ run(LV2_Handle handle, uint32_t n_samples)
/* Process incoming MIDI events */
if (self->midiin) {
- LV2_Atom_Event const* ev = (LV2_Atom_Event const*) ((&(self->midiin)->body) + 1); // lv2_atom_sequence_begin
- while( (const uint8_t*)ev < ((const uint8_t*) &(self->midiin)->body + (self->midiin)->atom.size) ) {
+ LV2_Atom_Event const* ev = (LV2_Atom_Event const*)((&(self->midiin)->body) + 1); // lv2_atom_sequence_begin
+ while( // !lv2_atom_sequence_is_end
+ (const uint8_t*)ev < ((const uint8_t*) &(self->midiin)->body + (self->midiin)->atom.size)
+ )
+ {
if (ev->body.type == self->midi_MidiEvent) {
if (written + BUFFER_SIZE_SAMPLES < ev->time.frames
&& ev->time.frames < n_samples) {
@@ -145,7 +148,8 @@ run(LV2_Handle handle, uint32_t n_samples)
/* send midi message to synth */
synth_parse_midi(self->synth, (const uint8_t*)(ev+1), ev->body.size);
}
- ev = (LV2_Atom_Event const*)((const uint8_t*)ev + sizeof(LV2_Atom_Event) + ((ev->body.size + 7) & ~7));
+ ev = (LV2_Atom_Event const*) // lv2_atom_sequence_next()
+ ((const uint8_t*)ev + sizeof(LV2_Atom_Event) + ((ev->body.size + 7) & ~7));
}
}