From 9b9a6c9e3eb8da7eb1decd963a6c2f0e69b57ed4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Nov 2008 01:13:53 +0000 Subject: Fix 'control change for unknown port' message on patch loading. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1783 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/PostProcessor.cpp | 23 +++++++++++++++-------- 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::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, 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) { } -- cgit v1.2.1