summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-09 02:57:58 +0000
committerDavid Robillard <d@drobilla.net>2007-04-09 02:57:58 +0000
commit6c9ce11ed66e15d02537e07bd767f5633471f71b (patch)
tree8d12393c57f4180a7ad40480624452b593a94d68 /src/libs
parentccb22e332e033e23d6dd6d4f144f429f95c1a547 (diff)
downloadingen-6c9ce11ed66e15d02537e07bd767f5633471f71b.tar.gz
ingen-6c9ce11ed66e15d02537e07bd767f5633471f71b.tar.bz2
ingen-6c9ce11ed66e15d02537e07bd767f5633471f71b.zip
Internal subpatch connection bugfix.
git-svn-id: http://svn.drobilla.net/lad/ingen@431 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/client/Store.cpp23
1 files changed, 15 insertions, 8 deletions
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<PatchModel>
Store::connection_patch(const Path& src_port_path, const Path& dst_port_path)
{
+ SharedPtr<PatchModel> patch;
+
// Connection between patch ports
- if (src_port_path.parent() == dst_port_path.parent()) {
- SharedPtr<PatchModel> patch = PtrCast<PatchModel>(this->object(src_port_path.parent()));
- if (patch)
- return patch;
- }
+ if (src_port_path.parent() == dst_port_path.parent())
+ patch = PtrCast<PatchModel>(this->object(src_port_path.parent()));
+ else if (src_port_path.parent() == dst_port_path.parent().parent())
+ patch = PtrCast<PatchModel>(this->object(src_port_path.parent()));
+ else if (src_port_path.parent().parent() == dst_port_path.parent())
+ patch = PtrCast<PatchModel>(this->object(dst_port_path.parent()));
+ else
+ patch = PtrCast<PatchModel>(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<PatchModel>(this->object(src_port_path.parent().parent()));
+ return patch;
}