diff options
-rw-r--r-- | src/engine/PostProcessor.cpp | 23 | ||||
-rw-r--r-- | src/engine/events/CreateNodeEvent.cpp | 16 |
2 files changed, 23 insertions, 16 deletions
diff --git a/src/engine/PostProcessor.cpp b/src/engine/PostProcessor.cpp index 9a8b540a..23b841ca 100644 --- a/src/engine/PostProcessor.cpp +++ b/src/engine/PostProcessor.cpp @@ -46,16 +46,14 @@ PostProcessor::process() { const FrameTime end_time = _max_time.get(); - /* Process any audio thread generated events */ + /* Note the normal (pre-processed client originated) events must + * be sent first, since they could have e.g. created a port which + * is by now inserted, running, and may broadcast something to + * the client. If the broadcast happened first the client would + * not yet know about the port's existance. */ + /* FIXME: process events from all threads if parallel */ - while (_engine.audio_driver()->context().event_sink().read( - _event_buffer_size, _event_buffer)) { - if (((Event*)_event_buffer)->time() > end_time) - break; // FIXME: loses event? - ((Event*)_event_buffer)->post_process(); - } - /* Process normal events */ Raul::List<Event*>::Node* n = _events.head(); while (n) { @@ -68,6 +66,15 @@ PostProcessor::process() delete n; n = next; } + + /* Process audio thread generated events */ + while (_engine.audio_driver()->context().event_sink().read( + _event_buffer_size, _event_buffer)) { + if (((Event*)_event_buffer)->time() > end_time) + break; // FIXME: loses event? + ((Event*)_event_buffer)->post_process(); + } + } diff --git a/src/engine/events/CreateNodeEvent.cpp b/src/engine/events/CreateNodeEvent.cpp index 29f7f96e..d88afb89 100644 --- a/src/engine/events/CreateNodeEvent.cpp +++ b/src/engine/events/CreateNodeEvent.cpp @@ -38,14 +38,14 @@ namespace Ingen { CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& plugin_uri, bool polyphonic) -: QueuedEvent(engine, responder, timestamp), - _path(path), - _plugin_uri(plugin_uri), - _polyphonic(polyphonic), - _patch(NULL), - _node(NULL), - _compiled_patch(NULL), - _node_already_exists(false) + : QueuedEvent(engine, responder, timestamp) + , _path(path) + , _plugin_uri(plugin_uri) + , _polyphonic(polyphonic) + , _patch(NULL) + , _node(NULL) + , _compiled_patch(NULL) + , _node_already_exists(false) { } |