From 62d76290ae0eb783db0e24338c17adb08d845a73 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Jul 2006 22:13:38 +0000 Subject: Fixes for connecting directly from a patch input to a patch output git-svn-id: http://svn.drobilla.net/lad/ingen@81 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/ConnectionEvent.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/libs/engine/events/ConnectionEvent.cpp') diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index aedfd881..652fe801 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -178,29 +178,33 @@ TypedConnectionEvent::pre_process() Node* const src_node = m_src_port->parent_node(); Node* const dst_node = m_dst_port->parent_node(); + // Connection to a patch port from inside the patch if (src_node->parent_patch() != dst_node->parent_patch()) { - // Connection to a patch port from inside the patch + assert(src_node->parent() == dst_node || dst_node->parent() == src_node); if (src_node->parent() == dst_node) m_patch = dynamic_cast(dst_node); else m_patch = dynamic_cast(src_node); + + // Connection from a patch input to a patch output (pass through) + } else if (src_node == dst_node && dynamic_cast(src_node)) { + m_patch = dynamic_cast(src_node); + + // Normal connection between nodes with the same parent } else { - // Normal connection between nodes with the same parent m_patch = src_node->parent_patch(); } assert(m_patch); if (src_node == NULL || dst_node == NULL) { - cerr << "ERR 1\n"; m_succeeded = false; QueuedEvent::pre_process(); return; } - if (src_node->parent() != m_patch && dst_node->parent() != m_patch) { - cerr << "ERR 2\n"; + if (m_patch != src_node && src_node->parent() != m_patch && dst_node->parent() != m_patch) { m_succeeded = false; QueuedEvent::pre_process(); return; -- cgit v1.2.1