diff options
author | David Robillard <d@drobilla.net> | 2008-11-16 16:58:30 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-16 16:58:30 +0000 |
commit | 9c075799fdadf3d35cc4544ee0331e572d32cbe9 (patch) | |
tree | 15cf65199f1259bd81a281a6ca292f170fe3ff7b /src/engine | |
parent | 422694ebc886882fc8c2f0555a725d052dfc935c (diff) | |
download | ingen-9c075799fdadf3d35cc4544ee0331e572d32cbe9.tar.gz ingen-9c075799fdadf3d35cc4544ee0331e572d32cbe9.tar.bz2 ingen-9c075799fdadf3d35cc4544ee0331e572d32cbe9.zip |
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
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/ClientBroadcaster.cpp | 28 | ||||
-rw-r--r-- | src/engine/ClientBroadcaster.hpp | 3 | ||||
-rw-r--r-- | src/engine/ObjectSender.cpp | 2 | ||||
-rw-r--r-- | src/engine/ObjectSender.hpp | 2 | ||||
-rw-r--r-- | src/engine/events/RequestAllObjectsEvent.cpp | 3 | ||||
-rw-r--r-- | src/engine/events/RequestObjectEvent.cpp | 25 |
6 files changed, 5 insertions, 58 deletions
diff --git a/src/engine/ClientBroadcaster.cpp b/src/engine/ClientBroadcaster.cpp index aaee7b4a..a810aef2 100644 --- a/src/engine/ClientBroadcaster.cpp +++ b/src/engine/ClientBroadcaster.cpp @@ -136,22 +136,6 @@ ClientBroadcaster::send_plugins(const NodeFactory::Plugins& plugins) void -ClientBroadcaster::send_node(const NodeImpl* node, bool recursive) -{ - for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) - ObjectSender::send_node((*i).second, node, recursive); -} - - -void -ClientBroadcaster::send_port(const PortImpl* port) -{ - for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) - ObjectSender::send_port((*i).second, port); -} - - -void ClientBroadcaster::send_destroyed(const string& path) { assert(path != "/"); @@ -257,18 +241,6 @@ ClientBroadcaster::send_object(const GraphObjectImpl* p, bool recursive) } -/** Send a patch. - * - * @param recursive If true send all children of object - */ -void -ClientBroadcaster::send_patch(const PatchImpl* p, bool recursive) -{ - for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) - ObjectSender::send_patch((*i).second, p, recursive); -} - - /** Sends notification of an GraphObject's renaming */ void diff --git a/src/engine/ClientBroadcaster.hpp b/src/engine/ClientBroadcaster.hpp index 9ddf1ed7..daf50a80 100644 --- a/src/engine/ClientBroadcaster.hpp +++ b/src/engine/ClientBroadcaster.hpp @@ -68,9 +68,6 @@ public: void send_plugins(const NodeFactory::Plugins& plugin_list); void send_object(const GraphObjectImpl* p, bool recursive); - void send_patch(const PatchImpl* p, bool recursive); - void send_node(const NodeImpl* node, bool recursive); - void send_port(const PortImpl* port); void send_destroyed(const string& path); void send_patch_cleared(const string& patch_path); void send_connection(const SharedPtr<const ConnectionImpl> connection); diff --git a/src/engine/ObjectSender.cpp b/src/engine/ObjectSender.cpp index 161769d8..aff9514e 100644 --- a/src/engine/ObjectSender.cpp +++ b/src/engine/ObjectSender.cpp @@ -33,8 +33,6 @@ namespace Ingen { void ObjectSender::send_object(ClientInterface* client, const GraphObjectImpl* object, bool recursive) { - cout << "SEND OBJECT " << object->path() << " RECURSIVE: " << recursive << endl; - if (client->new_object(object)) return; diff --git a/src/engine/ObjectSender.hpp b/src/engine/ObjectSender.hpp index f4a5959d..19cb79c0 100644 --- a/src/engine/ObjectSender.hpp +++ b/src/engine/ObjectSender.hpp @@ -45,6 +45,8 @@ class PluginImpl; class ObjectSender { public: static void send_object(ClientInterface* client, const GraphObjectImpl* object, bool recursive); + +private: static void send_patch(ClientInterface* client, const PatchImpl* patch, bool recursive, bool bundle=true); static void send_node(ClientInterface* client, const NodeImpl* node, bool recursive, bool bundle=true); static void send_port(ClientInterface* client, const PortImpl* port, bool bundle=true); 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<PatchImpl*>(_object); - if (patch) { - _responder->respond_ok(); - ObjectSender::send_patch(_responder->client(), patch, true); - return; - } - - NodeImpl* const node = dynamic_cast<NodeImpl*>(_object); - if (node) { - _responder->respond_ok(); - ObjectSender::send_node(_responder->client(), node, true); - return; - } - - PortImpl* const port = dynamic_cast<PortImpl*>(_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."); } |