From 2290ef683f154abebe60dfb0392a21325d2a61e0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 Mar 2011 01:01:50 +0000 Subject: Use event extension context to map MidiEvent. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3061 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/ControlBindings.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/engine/ControlBindings.cpp') diff --git a/src/engine/ControlBindings.cpp b/src/engine/ControlBindings.cpp index 73e0e4c7..7b942008 100644 --- a/src/engine/ControlBindings.cpp +++ b/src/engine/ControlBindings.cpp @@ -151,8 +151,11 @@ ControlBindings::port_value_changed(ProcessContext& context, PortImpl* port) default: break; } - if (size > 0) - _feedback->append(0, 0, uris.midi_MidiEvent.id, size, buf); + if (size > 0) { + _feedback->append(0, 0, + uris.global_to_event(uris.midi_MidiEvent.id).second, + size, buf); + } } } @@ -340,12 +343,15 @@ ControlBindings::pre_process(ProcessContext& context, EventBuffer* buffer) const Shared::LV2URIMap& uris = *context.engine().world()->uris().get(); + // TODO: cache + const uint32_t midi_event_type = uris.global_to_event(uris.midi_MidiEvent.id).second; + // Learn from input if necessary if (_learn_port) { for (buffer->rewind(); buffer->get_event(&frames, &subframes, &type, &size, &buf); buffer->increment()) { - if (type != uris.midi_MidiEvent.id) + if (type != midi_event_type) continue; const Key key = midi_event_key(size, buf, value); @@ -362,7 +368,7 @@ ControlBindings::pre_process(ProcessContext& context, EventBuffer* buffer) for (buffer->rewind(); buffer->get_event(&frames, &subframes, &type, &size, &buf); buffer->increment()) { - if (type != uris.midi_MidiEvent.id) + if (type != midi_event_type) continue; const Key key = midi_event_key(size, buf, value); -- cgit v1.2.1