diff options
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/LoadPluginsEvent.cpp | 15 | ||||
-rw-r--r-- | src/libs/engine/events/LoadPluginsEvent.h | 8 |
2 files changed, 11 insertions, 12 deletions
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 <iostream> using std::cerr; @@ -27,9 +28,10 @@ using std::cerr; namespace Ingen { -LoadPluginsEvent::LoadPluginsEvent(Engine& engine, SharedPtr<Shared::Responder> responder, SampleCount timestamp) -: QueuedEvent(engine, responder, timestamp) +LoadPluginsEvent::LoadPluginsEvent(Engine& engine, SharedPtr<Shared::Responder> 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<Shared::Responder> responder, SampleCount timestamp); + LoadPluginsEvent(Engine& engine, + SharedPtr<Shared::Responder> responder, + SampleCount timestamp, + QueuedEventSource* source); void pre_process(); void post_process(); - -private: - std::list<Plugin*> _plugins; }; |