summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-07-03 22:13:38 +0000
committerDavid Robillard <d@drobilla.net>2006-07-03 22:13:38 +0000
commit62d76290ae0eb783db0e24338c17adb08d845a73 (patch)
treef3be39dadd5563ebf5a03ef9bb81bc4b6665fa1c /src/libs/engine/events
parent2df7c1a1e805bea3d439d345d37469a8d202a656 (diff)
downloadingen-62d76290ae0eb783db0e24338c17adb08d845a73.tar.gz
ingen-62d76290ae0eb783db0e24338c17adb08d845a73.tar.bz2
ingen-62d76290ae0eb783db0e24338c17adb08d845a73.zip
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
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/ConnectionEvent.cpp14
1 files changed, 9 insertions, 5 deletions
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<T>::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<Patch*>(dst_node);
else
m_patch = dynamic_cast<Patch*>(src_node);
+
+ // Connection from a patch input to a patch output (pass through)
+ } else if (src_node == dst_node && dynamic_cast<Patch*>(src_node)) {
+ m_patch = dynamic_cast<Patch*>(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;