diff options
author | David Robillard <d@drobilla.net> | 2012-07-26 16:38:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-07-26 16:38:44 +0000 |
commit | 024d857f0dc239726cc8c042e8b9296e8886af7d (patch) | |
tree | 3591b5ac01607b8879342ea8657285f2fecc9abf /src/server/Context.cpp | |
parent | 1b38b8bc4e4e5ca9250cca15bb547ce926b0592e (diff) | |
download | ingen-024d857f0dc239726cc8c042e8b9296e8886af7d.tar.gz ingen-024d857f0dc239726cc8c042e8b9296e8886af7d.tar.bz2 ingen-024d857f0dc239726cc8c042e8b9296e8886af7d.zip |
Fix post processor ordering to be correctly monotonic between both pre-processed events and notifications.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4560 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Context.cpp')
-rw-r--r-- | src/server/Context.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/Context.cpp b/src/server/Context.cpp index 0f7555a4..745b849f 100644 --- a/src/server/Context.cpp +++ b/src/server/Context.cpp @@ -33,10 +33,11 @@ struct Notification LV2_URID k = 0, uint32_t s = 0, Raul::Atom::TypeID t = 0) - : port(p), key(k), size(s), type(t) + : port(p), time(f), key(k), size(s), type(t) {} PortImpl* port; + FrameTime time; LV2_URID key; uint32_t size; Raul::Atom::TypeID type; @@ -74,11 +75,15 @@ Context::notify(LV2_URID key, } void -Context::emit_notifications() +Context::emit_notifications(FrameTime end) { const uint32_t read_space = _event_sink.read_space(); Notification note; for (uint32_t i = 0; i < read_space; i += sizeof(note)) { + if (_event_sink.peek(sizeof(note), ¬e) != sizeof(note) || + note.time >= end) { + return; + } if (_event_sink.read(sizeof(note), ¬e) == sizeof(note)) { Raul::Atom value = _engine.world()->forge().alloc( note.size, note.type, NULL); |