summaryrefslogtreecommitdiffstats
path: root/src/engine/events/Disconnect.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-03 20:39:18 +0000
committerDavid Robillard <d@drobilla.net>2010-02-03 20:39:18 +0000
commitaef3c9348218029a077f40081fd078a9e2ee85ca (patch)
treeb77d6ef50f66004129a03cb0751b653336c50f14 /src/engine/events/Disconnect.cpp
parent3e495d47f06cca50521076e8f77a966dfec521ab (diff)
downloadingen-aef3c9348218029a077f40081fd078a9e2ee85ca.tar.gz
ingen-aef3c9348218029a077f40081fd078a9e2ee85ca.tar.bz2
ingen-aef3c9348218029a077f40081fd078a9e2ee85ca.zip
Responder => Request, and handle EventSource unblocking from Request (simplify Event interfaces).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2417 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events/Disconnect.cpp')
-rw-r--r--src/engine/events/Disconnect.cpp52
1 files changed, 27 insertions, 25 deletions
diff --git a/src/engine/events/Disconnect.cpp b/src/engine/events/Disconnect.cpp
index 007886f1..d1cfefe6 100644
--- a/src/engine/events/Disconnect.cpp
+++ b/src/engine/events/Disconnect.cpp
@@ -19,7 +19,7 @@
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
#include "events/Disconnect.hpp"
-#include "Responder.hpp"
+#include "Request.hpp"
#include "Engine.hpp"
#include "ConnectionImpl.hpp"
#include "InputPort.hpp"
@@ -37,12 +37,12 @@ namespace Events {
Disconnect::Disconnect(
- Engine& engine,
- SharedPtr<Responder> responder,
- SampleCount timestamp,
- const Raul::Path& src_port_path,
- const Raul::Path& dst_port_path)
- : QueuedEvent(engine, responder, timestamp)
+ Engine& engine,
+ SharedPtr<Request> request,
+ SampleCount timestamp,
+ const Raul::Path& src_port_path,
+ const Raul::Path& dst_port_path)
+ : QueuedEvent(engine, request, timestamp)
, _src_port_path(src_port_path)
, _dst_port_path(dst_port_path)
, _patch(NULL)
@@ -58,19 +58,19 @@ Disconnect::Disconnect(
Disconnect::Disconnect(
Engine& engine,
- SharedPtr<Responder> responder,
+ SharedPtr<Request> request,
SampleCount timestamp,
PortImpl* const src_port,
PortImpl* const dst_port)
-: QueuedEvent(engine, responder, timestamp),
- _src_port_path(src_port->path()),
- _dst_port_path(dst_port->path()),
- _patch(src_port->parent_node()->parent_patch()),
- _src_port(src_port),
- _dst_port(dst_port),
- _lookup(false),
- _compiled_patch(NULL),
- _error(NO_ERROR)
+ : QueuedEvent(engine, request, timestamp)
+ , _src_port_path(src_port->path())
+ , _dst_port_path(dst_port->path())
+ , _patch(src_port->parent_node()->parent_patch())
+ , _src_port(src_port)
+ , _dst_port(dst_port)
+ , _lookup(false)
+ , _compiled_patch(NULL)
+ , _error(NO_ERROR)
{
// FIXME: These break for patch ports.. is that ok?
/*assert(src_port->is_output());
@@ -205,14 +205,16 @@ Disconnect::execute(ProcessContext& context)
void
Disconnect::post_process()
{
- if (_error == NO_ERROR) {
- _responder->respond_ok();
- _engine.broadcaster()->disconnect(_src_port->path(), _dst_port->path());
- } else {
- string msg = "Unable to disconnect ";
- msg.append(_src_port_path.str() + " -> " + _dst_port_path.str());
- _responder->respond_error(msg);
- }
+ if (_error == NO_ERROR) {
+ if (_request)
+ _request->respond_ok();
+ _engine.broadcaster()->disconnect(_src_port->path(), _dst_port->path());
+ } else {
+ string msg = "Unable to disconnect ";
+ msg.append(_src_port_path.str() + " -> " + _dst_port_path.str());
+ if (_request)
+ _request->respond_error(msg);
+ }
}