aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-25 11:06:47 +0200
committerDavid Robillard <d@drobilla.net>2020-07-25 11:06:47 +0200
commit001234daeb43b4c54b49ffca527cc92cd4d9b718 (patch)
tree32e834d7f3df18d8ae1653122073422162d419d5
parent6b4cee5bc2338793d2a7419e5113a9b3c99df8e1 (diff)
downloadlv2-001234daeb43b4c54b49ffca527cc92cd4d9b718.tar.xz
Revert "Use LV2_ATOM_BODY macros in examples instead of pointer arithmetic"
This reverts commit 3aad5eb1b08ed5c27e60aa36021c4a85ce90c08f, which broke the example plugins.
-rw-r--r--plugins/eg-fifths.lv2/fifths.c2
-rw-r--r--plugins/eg-midigate.lv2/midigate.c2
-rw-r--r--plugins/eg-sampler.lv2/sampler.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c
index 5782417..0abcfbd 100644
--- a/plugins/eg-fifths.lv2/fifths.c
+++ b/plugins/eg-fifths.lv2/fifths.c
@@ -128,7 +128,7 @@ run(LV2_Handle instance,
// Read incoming events
LV2_ATOM_SEQUENCE_FOREACH(self->in_port, ev) {
if (ev->body.type == uris->midi_Event) {
- const uint8_t* const msg = (const uint8_t*)LV2_ATOM_BODY_CONST(ev);
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
switch (lv2_midi_message_type(msg)) {
case LV2_MIDI_MSG_NOTE_ON:
case LV2_MIDI_MSG_NOTE_OFF:
diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c
index 6c77828..70901f6 100644
--- a/plugins/eg-midigate.lv2/midigate.c
+++ b/plugins/eg-midigate.lv2/midigate.c
@@ -161,7 +161,7 @@ run(LV2_Handle instance, uint32_t sample_count)
LV2_ATOM_SEQUENCE_FOREACH(self->control, ev) {
if (ev->body.type == self->uris.midi_MidiEvent) {
- const uint8_t* const msg = (const uint8_t*)LV2_ATOM_BODY_CONST(ev);
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
switch (lv2_midi_message_type(msg)) {
case LV2_MIDI_MSG_NOTE_ON:
++self->n_active_notes;
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index 646da2d..17f62a8 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -322,7 +322,7 @@ handle_event(Sampler* self, LV2_Atom_Event* ev)
PeaksURIs* peaks_uris = &self->psend.uris;
if (ev->body.type == uris->midi_Event) {
- const uint8_t* const msg = (const uint8_t*)LV2_ATOM_BODY_CONST(ev);
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
switch (lv2_midi_message_type(msg)) {
case LV2_MIDI_MSG_NOTE_ON:
self->frame = 0;