summaryrefslogtreecommitdiffstats
path: root/src/libs/client/Store.cpp
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/client/Store.cpp
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/client/Store.cpp')
-rw-r--r--src/libs/client/Store.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index 5bf8175d..a8dd69e8 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -95,7 +95,7 @@ Store::object(const string& path)
return (*i).second;
}
-
+#if 0
CountedPtr<PatchModel>
Store::patch(const string& path)
{
@@ -146,7 +146,7 @@ Store::port(const string& path)
return NULL;
}
-
+#endif
void
Store::add_plugin(CountedPtr<PluginModel> pm)
@@ -345,11 +345,16 @@ Store::control_change_event(const string& port_path, float value)
void
Store::connection_event(const Path& src_port_path, const Path& dst_port_path)
{
- // ConnectionModel has the clever patch-path-figuring-out stuff in it, so
- // just make one right away to get at that
- ConnectionModel* cm = new ConnectionModel(src_port_path, dst_port_path);
+ CountedPtr<PortModel> src_port = object(src_port_path);
+ CountedPtr<PortModel> dst_port = object(dst_port_path);
+
+ assert(src_port);
+ assert(dst_port);
- CountedPtr<PatchModel> patch = this->patch(cm->patch_path());
+ CountedPtr<ConnectionModel> cm = new ConnectionModel(src_port, dst_port);
+
+ CountedPtr<PatchModel> patch = this->object(cm->patch_path());
+
if (patch)
patch->add_connection(cm);
else
@@ -366,7 +371,7 @@ Store::disconnection_event(const Path& src_port_path, const Path& dst_port_path)
assert(src.parent().parent() == dst.parent().parent());
const Path& patch_path = src.parent().parent();
- CountedPtr<PatchModel> patch = this->patch(patch_path);
+ CountedPtr<PatchModel> patch = this->object(patch_path);
if (patch)
patch->remove_connection(src, dst);
else