summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
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;
}