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/RequestAllObjectsEvent.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/RequestAllObjectsEvent.cpp')
-rw-r--r-- | src/libs/engine/events/RequestAllObjectsEvent.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libs/engine/events/RequestAllObjectsEvent.cpp b/src/libs/engine/events/RequestAllObjectsEvent.cpp index b28294cc..5eb780b3 100644 --- a/src/libs/engine/events/RequestAllObjectsEvent.cpp +++ b/src/libs/engine/events/RequestAllObjectsEvent.cpp @@ -18,12 +18,14 @@ #include "Responder.h" #include "Engine.h" #include "ObjectSender.h" +#include "ClientBroadcaster.h" +#include "ObjectStore.h" namespace Ingen { -RequestAllObjectsEvent::RequestAllObjectsEvent(CountedPtr<Responder> responder, SampleCount timestamp) -: QueuedEvent(responder, timestamp), +RequestAllObjectsEvent::RequestAllObjectsEvent(Engine& engine, CountedPtr<Responder> responder, SampleCount timestamp) +: QueuedEvent(engine, responder, timestamp), m_client(CountedPtr<ClientInterface>(NULL)) { } @@ -32,7 +34,7 @@ RequestAllObjectsEvent::RequestAllObjectsEvent(CountedPtr<Responder> responder, void RequestAllObjectsEvent::pre_process() { - m_client = _responder->find_client(); + m_client = _engine.client_broadcaster()->client(_responder->client_key()); QueuedEvent::pre_process(); } @@ -43,9 +45,14 @@ RequestAllObjectsEvent::post_process() { if (m_client) { _responder->respond_ok(); - ObjectSender::send_all(m_client.get()); + + // Everything is a child of the root patch, so this sends it all + Patch* root = _engine.object_store()->find_patch("/"); + if (root) + ObjectSender::send_patch(m_client.get(), root); + } else { - _responder->respond_error("Invalid URL"); + _responder->respond_error("Unable to find client to send all objects"); } } |