From 72a21b5dbe82ac726f4d7a4308601d802001d9c0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Apr 2007 03:46:40 +0000 Subject: Serialization (both saving and restoring) of nested patches. Serialization of patch (float) metadata. Removed useless cruft from Save dialog. Remember filename on save to avoid save as next time. git-svn-id: http://svn.drobilla.net/lad/ingen@437 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/ConnectionEvent.cpp | 14 ++++++-------- src/libs/engine/events/ConnectionEvent.h | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index af35265b..7c4b4422 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -84,16 +84,14 @@ ConnectionEvent::pre_process() return; } - /*if ( !( _src_port->is_output() && _dst_port->is_input() ) ) { - _error = TYPE_MISMATCH; - QueuedEvent::pre_process(); - return; - }*/ - _dst_input_port = dynamic_cast(_dst_port); _src_output_port = dynamic_cast(_src_port); - assert(_src_output_port); - assert(_dst_input_port); + + if (!_dst_input_port || !_src_output_port) { + _error = DIRECTION_MISMATCH; + QueuedEvent::pre_process(); + return; + } if (_dst_input_port->is_connected_to(_src_output_port)) { _error = ALREADY_CONNECTED; diff --git a/src/libs/engine/events/ConnectionEvent.h b/src/libs/engine/events/ConnectionEvent.h index 8f5e1cc2..bebb6cfd 100644 --- a/src/libs/engine/events/ConnectionEvent.h +++ b/src/libs/engine/events/ConnectionEvent.h @@ -61,6 +61,7 @@ private: PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, TYPE_MISMATCH, + DIRECTION_MISMATCH, ALREADY_CONNECTED, PARENTS_NOT_FOUND }; -- cgit v1.2.1