From 0a4dfb16428463d10d12a821afaed866a701550d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 3 Jul 2007 04:42:41 +0000 Subject: Fix crash on MIDI controller receiving. Fixed various plugin loading related bugs. Fix strange liblo bug.. maybe.. Little bit of preliminary LV2 GUI stuff. git-svn-id: http://svn.drobilla.net/lad/ingen@561 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/LoadPluginsEvent.cpp | 15 +++++++-------- src/libs/engine/events/LoadPluginsEvent.h | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/LoadPluginsEvent.cpp b/src/libs/engine/events/LoadPluginsEvent.cpp index a126e3b2..b06d1817 100644 --- a/src/libs/engine/events/LoadPluginsEvent.cpp +++ b/src/libs/engine/events/LoadPluginsEvent.cpp @@ -20,6 +20,7 @@ #include "Engine.h" #include "NodeFactory.h" #include "ClientBroadcaster.h" +#include "QueuedEventSource.h" #include using std::cerr; @@ -27,9 +28,10 @@ using std::cerr; namespace Ingen { -LoadPluginsEvent::LoadPluginsEvent(Engine& engine, SharedPtr responder, SampleCount timestamp) -: QueuedEvent(engine, responder, timestamp) +LoadPluginsEvent::LoadPluginsEvent(Engine& engine, SharedPtr responder, SampleCount timestamp, QueuedEventSource* source) +: QueuedEvent(engine, responder, timestamp, true, source) { + /* Not sure why this has to be blocking, but it fixes some nasty bugs.. */ } void @@ -37,18 +39,15 @@ LoadPluginsEvent::pre_process() { _engine.node_factory()->load_plugins(); - // FIXME: send the changes (added and removed plugins) instead of the entire list each time - - // Take a copy to send in the post processing thread (to avoid problems - // because std::list isn't thread safe) - _plugins = _engine.node_factory()->plugins(); - QueuedEvent::pre_process(); } void LoadPluginsEvent::post_process() { + if (_source) + _source->unblock(); + _responder->respond_ok(); } diff --git a/src/libs/engine/events/LoadPluginsEvent.h b/src/libs/engine/events/LoadPluginsEvent.h index b6de5e5c..e56de796 100644 --- a/src/libs/engine/events/LoadPluginsEvent.h +++ b/src/libs/engine/events/LoadPluginsEvent.h @@ -33,13 +33,13 @@ class Plugin; class LoadPluginsEvent : public QueuedEvent { public: - LoadPluginsEvent(Engine& engine, SharedPtr responder, SampleCount timestamp); + LoadPluginsEvent(Engine& engine, + SharedPtr responder, + SampleCount timestamp, + QueuedEventSource* source); void pre_process(); void post_process(); - -private: - std::list _plugins; }; -- cgit v1.2.1