diff options
author | David Robillard <d@drobilla.net> | 2006-09-08 03:58:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-09-08 03:58:00 +0000 |
commit | 48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa (patch) | |
tree | 9da4b4b075791ac1ec78b499dbcbec6101f54690 /src/libs/engine/events/RequestPluginsEvent.cpp | |
parent | acbe9a26ec3ab689e430225d15e95e73a7378aa9 (diff) | |
download | ingen-48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa.tar.gz ingen-48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa.tar.bz2 ingen-48f87f1f1649fb7e169fdaac2cd38370e8a4a1fa.zip |
De-singleton-ified Engine
Slight rework of Responder/ClientKey/ClientInterface for Requests
git-svn-id: http://svn.drobilla.net/lad/ingen@119 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/RequestPluginsEvent.cpp')
-rw-r--r-- | src/libs/engine/events/RequestPluginsEvent.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libs/engine/events/RequestPluginsEvent.cpp b/src/libs/engine/events/RequestPluginsEvent.cpp index 65dfb7aa..9efb2388 100644 --- a/src/libs/engine/events/RequestPluginsEvent.cpp +++ b/src/libs/engine/events/RequestPluginsEvent.cpp @@ -18,12 +18,13 @@ #include "Responder.h" #include "Engine.h" #include "ClientBroadcaster.h" +#include "NodeFactory.h" namespace Ingen { -RequestPluginsEvent::RequestPluginsEvent(CountedPtr<Responder> responder, SampleCount timestamp) -: QueuedEvent(responder, timestamp), +RequestPluginsEvent::RequestPluginsEvent(Engine& engine, CountedPtr<Responder> responder, SampleCount timestamp) +: QueuedEvent(engine, responder, timestamp), m_client(CountedPtr<ClientInterface>(NULL)) { } @@ -32,8 +33,12 @@ RequestPluginsEvent::RequestPluginsEvent(CountedPtr<Responder> responder, Sample void RequestPluginsEvent::pre_process() { - m_client = _responder->find_client(); + m_client = _engine.client_broadcaster()->client(_responder->client_key()); + // Take a copy to send in the post processing thread (to avoid problems + // because std::list isn't thread safe) + m_plugins = _engine.node_factory()->plugins(); + QueuedEvent::pre_process(); } @@ -42,10 +47,10 @@ void RequestPluginsEvent::post_process() { if (m_client) { - Engine::instance().client_broadcaster()->send_plugins_to(m_client.get()); + _engine.client_broadcaster()->send_plugins_to(m_client.get(), m_plugins); _responder->respond_ok(); } else { - _responder->respond_error("Invalid URL"); + _responder->respond_error("Unable to find client to send plugins"); } } |