Browse Source

Revert "Use LV2_ATOM_BODY macros in examples instead of pointer arithmetic"

This reverts commit 3aad5eb1b0, which broke the
example plugins.
zrythm_meson
David Robillard 2 years ago
parent
commit
001234daeb
  1. 2
      plugins/eg-fifths.lv2/fifths.c
  2. 2
      plugins/eg-midigate.lv2/midigate.c
  3. 2
      plugins/eg-sampler.lv2/sampler.c

2
plugins/eg-fifths.lv2/fifths.c

@ -128,7 +128,7 @@ run(LV2_Handle instance, @@ -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:

2
plugins/eg-midigate.lv2/midigate.c

@ -161,7 +161,7 @@ run(LV2_Handle instance, uint32_t sample_count) @@ -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;

2
plugins/eg-sampler.lv2/sampler.c

@ -322,7 +322,7 @@ handle_event(Sampler* self, LV2_Atom_Event* ev) @@ -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;

Loading…
Cancel
Save