From 6c9ce11ed66e15d02537e07bd767f5633471f71b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Apr 2007 02:57:58 +0000 Subject: Internal subpatch connection bugfix. git-svn-id: http://svn.drobilla.net/lad/ingen@431 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/Store.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 304056a3..f972c3ef 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -447,16 +447,23 @@ Store::control_change_event(const Path& port_path, float value) SharedPtr Store::connection_patch(const Path& src_port_path, const Path& dst_port_path) { + SharedPtr patch; + // Connection between patch ports - if (src_port_path.parent() == dst_port_path.parent()) { - SharedPtr patch = PtrCast(this->object(src_port_path.parent())); - if (patch) - return patch; - } + if (src_port_path.parent() == dst_port_path.parent()) + patch = PtrCast(this->object(src_port_path.parent())); + else if (src_port_path.parent() == dst_port_path.parent().parent()) + patch = PtrCast(this->object(src_port_path.parent())); + else if (src_port_path.parent().parent() == dst_port_path.parent()) + patch = PtrCast(this->object(dst_port_path.parent())); + else + patch = PtrCast(this->object(src_port_path.parent().parent())); + + if (!patch) + cerr << "ERROR: Unable to find connection patch " << src_port_path + << " -> " << dst_port_path << endl; - // Normal connection - assert(src_port_path.parent().parent() == dst_port_path.parent().parent()); - return PtrCast(this->object(src_port_path.parent().parent())); + return patch; } -- cgit v1.2.1