From 9c075799fdadf3d35cc4544ee0331e572d32cbe9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 16 Nov 2008 16:58:30 +0000 Subject: Use higher level object sending interface internally in engine. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1727 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/events/RequestAllObjectsEvent.cpp | 3 ++- src/engine/events/RequestObjectEvent.cpp | 25 +------------------------ 2 files changed, 3 insertions(+), 25 deletions(-) (limited to 'src/engine/events') diff --git a/src/engine/events/RequestAllObjectsEvent.cpp b/src/engine/events/RequestAllObjectsEvent.cpp index d57080aa..a4dbc1f2 100644 --- a/src/engine/events/RequestAllObjectsEvent.cpp +++ b/src/engine/events/RequestAllObjectsEvent.cpp @@ -21,6 +21,7 @@ #include "ObjectSender.hpp" #include "ClientBroadcaster.hpp" #include "EngineStore.hpp" +#include "PatchImpl.hpp" namespace Ingen { @@ -47,7 +48,7 @@ RequestAllObjectsEvent::post_process() // Everything is a child of the root patch, so this sends it all PatchImpl* root = _engine.engine_store()->find_patch("/"); if (root && _responder->client()) - ObjectSender::send_patch(_responder->client(), root, true); + ObjectSender::send_object(_responder->client(), root, true); } else { _responder->respond_error("Unable to find client to send all objects"); diff --git a/src/engine/events/RequestObjectEvent.cpp b/src/engine/events/RequestObjectEvent.cpp index 30f95c03..c7fdd2d8 100644 --- a/src/engine/events/RequestObjectEvent.cpp +++ b/src/engine/events/RequestObjectEvent.cpp @@ -63,31 +63,8 @@ RequestObjectEvent::post_process() { if (!_object) { _responder->respond_error("Unable to find object requested."); - } else if (_responder->client()) { - PatchImpl* const patch = dynamic_cast(_object); - if (patch) { - _responder->respond_ok(); - ObjectSender::send_patch(_responder->client(), patch, true); - return; - } - - NodeImpl* const node = dynamic_cast(_object); - if (node) { - _responder->respond_ok(); - ObjectSender::send_node(_responder->client(), node, true); - return; - } - - PortImpl* const port = dynamic_cast(_object); - if (port) { - _responder->respond_ok(); - ObjectSender::send_port(_responder->client(), port); - return; - } - - _responder->respond_error("Object of unknown type requested."); - + ObjectSender::send_object(_responder->client(), _object, true); } else { _responder->respond_error("Unable to find client to send object."); } -- cgit v1.2.1