summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PatchModel.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/PatchModel.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/PatchModel.cpp')
-rw-r--r--src/libs/client/PatchModel.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp
index 659fca23..d79fa74b 100644
--- a/src/libs/client/PatchModel.cpp
+++ b/src/libs/client/PatchModel.cpp
@@ -154,7 +154,7 @@ PatchModel::get_connection(const string& src_port_path, const string& dst_port_p
/** Add a connection to this patch.
*
- * Ownership of @a cm is taken, it will be deleted along with this PatchModel.
+ * A reference to @a cm is taken, released on deletion or removal.
* If @a cm only contains paths (not pointers to the actual ports), the ports
* will be found and set. The ports referred to not existing as children of
* this patch is a fatal error.
@@ -177,28 +177,28 @@ PatchModel::add_connection(CountedPtr<ConnectionModel> cm)
NodeModel* src_node = (cm->src_port_path().parent() == path())
? this : get_node(cm->src_port_path().parent().name()).get();
- PortModel* src_port = (src_node == NULL) ? NULL : src_node->get_port(cm->src_port_path().name()).get();
+ CountedPtr<PortModel> src_port = src_node->get_port(cm->src_port_path().name());
NodeModel* dst_node = (cm->dst_port_path().parent() == path())
? this : get_node(cm->dst_port_path().parent().name()).get();
- PortModel* dst_port = (dst_node == NULL) ? NULL : dst_node->get_port(cm->dst_port_path().name()).get();
+ CountedPtr<PortModel> dst_port = dst_node->get_port(cm->dst_port_path().name());
- assert(src_port != NULL);
- assert(dst_port != NULL);
+ assert(src_port);
+ assert(dst_port);
// Find source port pointer to 'resolve' connection if necessary
- if (cm->src_port() != NULL)
+ if (cm->src_port())
assert(cm->src_port() == src_port);
else
cm->set_src_port(src_port);
// Find dest port pointer to 'resolve' connection if necessary
- if (cm->dst_port() != NULL)
+ if (cm->dst_port())
assert(cm->dst_port() == dst_port);
else
cm->set_dst_port(dst_port);
- assert(cm->src_port() != NULL);
- assert(cm->dst_port() != NULL);
+ assert(cm->src_port());
+ assert(cm->dst_port());
m_connections.push_back(cm);