summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/RequestAllObjectsEvent.cpp3
-rw-r--r--src/engine/events/RequestObjectEvent.cpp25
2 files changed, 3 insertions, 25 deletions
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.");
}