summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-12-02 05:49:41 +0000
committerDavid Robillard <d@drobilla.net>2008-12-02 05:49:41 +0000
commitcb42d2cc4daa09c7d1db5515e39e94b9a5a43447 (patch)
treefa903dc4954836d0a3dbf4f6d43dc7c1b17784c4 /src/engine/events
parent5c150e73611323d739cc4a29d7f6ba529f136f87 (diff)
downloadingen-cb42d2cc4daa09c7d1db5515e39e94b9a5a43447.tar.gz
ingen-cb42d2cc4daa09c7d1db5515e39e94b9a5a43447.tar.bz2
ingen-cb42d2cc4daa09c7d1db5515e39e94b9a5a43447.zip
Rewrite pretty much everything to do with paths in Serialiser to actually make an ounce of sense.
Fix various things with nested patches (fix tickets #286 #289). Cascade successive pastes nicely. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1840 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/CreatePortEvent.cpp18
-rw-r--r--src/engine/events/CreatePortEvent.hpp3
2 files changed, 16 insertions, 5 deletions
diff --git a/src/engine/events/CreatePortEvent.cpp b/src/engine/events/CreatePortEvent.cpp
index 8cb30a4b..0e0dabd2 100644
--- a/src/engine/events/CreatePortEvent.cpp
+++ b/src/engine/events/CreatePortEvent.cpp
@@ -117,6 +117,8 @@ CreatePortEvent::pre_process()
assert(_ports_array->size() == _patch->num_ports());
+ } else {
+ _error = CREATION_FAILED;
}
}
QueuedEvent::pre_process();
@@ -149,12 +151,20 @@ CreatePortEvent::execute(ProcessContext& context)
void
CreatePortEvent::post_process()
{
- if (_error != NO_ERROR || !_patch_port) {
- const string msg = string("Could not create port - ").append(_path);
- _responder->respond_error(msg);
- } else {
+ string msg;
+ switch (_error) {
+ case NO_ERROR:
_responder->respond_ok();
_engine.broadcaster()->send_object(_patch_port, true);
+ break;
+ case UNKNOWN_TYPE:
+ msg = string("Could not create port ") + _path + " (Unknown type)";
+ _responder->respond_error(msg);
+ break;
+ case CREATION_FAILED:
+ msg = string("Could not create port ") + _path + " (Creation failed)";
+ _responder->respond_error(msg);
+ break;
}
}
diff --git a/src/engine/events/CreatePortEvent.hpp b/src/engine/events/CreatePortEvent.hpp
index c350d301..4a8233b7 100644
--- a/src/engine/events/CreatePortEvent.hpp
+++ b/src/engine/events/CreatePortEvent.hpp
@@ -51,7 +51,8 @@ private:
enum ErrorType {
NO_ERROR,
- UNKNOWN_TYPE
+ UNKNOWN_TYPE,
+ CREATION_FAILED
};
ErrorType _error;