summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-07 05:34:19 +0000
committerDavid Robillard <d@drobilla.net>2011-03-07 05:34:19 +0000
commita7d7fae434dc32e6787dfe54d1c30e0bccc660bd (patch)
tree74c46b462b3541e05d58b0219531a6aef1bd946a /src/engine
parent3dddff18969b94438bc44b8d3d3c769b9ffc0a1b (diff)
downloadingen-a7d7fae434dc32e6787dfe54d1c30e0bccc660bd.tar.gz
ingen-a7d7fae434dc32e6787dfe54d1c30e0bccc660bd.tar.bz2
ingen-a7d7fae434dc32e6787dfe54d1c30e0bccc660bd.zip
Apply LV2 UI MIDI event fix from Lars Luthman (ticket #651) with minor changes.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3048 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/InputPort.cpp10
-rw-r--r--src/engine/events/SetPortValue.cpp6
2 files changed, 13 insertions, 3 deletions
diff --git a/src/engine/InputPort.cpp b/src/engine/InputPort.cpp
index 0cd6e87a..f82b522a 100644
--- a/src/engine/InputPort.cpp
+++ b/src/engine/InputPort.cpp
@@ -210,7 +210,15 @@ InputPort::pre_process(Context& context)
void
InputPort::post_process(Context& context)
{
- _set_by_user = false;
+ if (_set_by_user) {
+ if (buffer_type() == PortType::EVENTS) {
+ // Clear events received via a SetPortValue
+ for (uint32_t v = 0; v < _poly; ++v) {
+ buffer(v)->clear();
+ }
+ }
+ _set_by_user = false;
+ }
}
diff --git a/src/engine/events/SetPortValue.cpp b/src/engine/events/SetPortValue.cpp
index a0c432c4..a8adf658 100644
--- a/src/engine/events/SetPortValue.cpp
+++ b/src/engine/events/SetPortValue.cpp
@@ -166,8 +166,10 @@ SetPortValue::apply(Context& context)
} else if (!strcmp(_value.get_blob_type(), "http://lv2plug.in/ns/ext/midi#MidiEvent")) {
ebuf->prepare_write(context);
- ebuf->append(frames, 0, uris.midi_MidiEvent.id, _value.data_size(),
- (const uint8_t*)_value.get_blob());
+ ebuf->append(frames, 0,
+ uris.global_to_event(uris.midi_MidiEvent.id).second,
+ _value.data_size(),
+ (const uint8_t*)_value.get_blob());
_port->raise_set_by_user_flag();
return;
}