aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-14 06:21:53 +0000
committerDavid Robillard <d@drobilla.net>2012-08-14 06:21:53 +0000
commit77f2d69d2f9995d7e803021373dbb18a199e645a (patch)
tree0cbe74b1be225bd5484fd80aa1aa7441c064dd39 /plugins
parente271414476309ef4491444376cf0050936816a24 (diff)
downloadlv2-77f2d69d2f9995d7e803021373dbb18a199e645a.tar.xz
midi: Remove non-standard midi:Tick message type.
midi: Add C definitions for message types and standard controllers. midi: Fix definition of SystemExclusive status byte. Use new MIDI API in eg-sampler.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/eg-sampler.lv2/sampler.c9
-rw-r--r--plugins/eg-sampler.lv2/uris.h5
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index 3415dcb..28b455b 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -46,6 +46,7 @@
#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "lv2/lv2plug.in/ns/ext/worker/worker.h"
+#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "./uris.h"
@@ -359,11 +360,15 @@ run(LV2_Handle instance,
LV2_ATOM_SEQUENCE_FOREACH(self->control_port, ev) {
self->frame_offset = ev->time.frames;
if (ev->body.type == uris->midi_Event) {
- uint8_t* const data = (uint8_t* const)(ev + 1);
- if ((data[0] & 0xF0) == 0x90) {
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
+ switch (lv2_midi_message_type(msg)) {
+ case LV2_MIDI_MSG_NOTE_ON:
start_frame = ev->time.frames;
self->frame = 0;
self->play = true;
+ break;
+ default:
+ break;
}
} else if (is_object_type(uris, ev->body.type)) {
const LV2_Atom_Object* obj = (LV2_Atom_Object*)&ev->body;
diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h
index 64ee6b1..3482dda 100644
--- a/plugins/eg-sampler.lv2/uris.h
+++ b/plugins/eg-sampler.lv2/uris.h
@@ -18,10 +18,9 @@
#ifndef SAMPLER_URIS_H
#define SAMPLER_URIS_H
-#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/ext/log/log.h"
-
-#define LV2_MIDI__MidiEvent "http://lv2plug.in/ns/ext/midi#MidiEvent"
+#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
+#include "lv2/lv2plug.in/ns/ext/state/state.h"
#define EG_SAMPLER_URI "http://lv2plug.in/plugins/eg-sampler"
#define EG_SAMPLER__file EG_SAMPLER_URI "#file"