From 3dd4b42f3054f819c865e9415c4b86ba78d43aec Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 11 May 2012 03:56:54 +0000 Subject: "Connection" => "Edge" git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4345 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 12 ++++++------ src/client/PatchModel.cpp | 37 ++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 25 deletions(-) (limited to 'src/client') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 042cba57..a78653e5 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -457,7 +457,7 @@ ClientStore::attempt_connection(const Raul::Path& tail_path, tail->connected_to(head); head->connected_to(tail); - patch->add_connection(cm); + patch->add_edge(cm); return true; } @@ -495,7 +495,7 @@ ClientStore::disconnect(const Raul::Path& src, SharedPtr patch = connection_patch(src_path, dst_path); if (patch) - patch->remove_connection(tail.get(), head.get()); + patch->remove_edge(tail.get(), head.get()); } void @@ -511,9 +511,9 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch, return; } - const PatchModel::Connections connections = patch->connections(); - for (PatchModel::Connections::const_iterator i = connections.begin(); - i != connections.end(); ++i) { + const PatchModel::Edges edges = patch->edges(); + for (PatchModel::Edges::const_iterator i = edges.begin(); + i != edges.end(); ++i) { SharedPtr c = PtrCast(i->second); if (c->tail()->parent() == object || c->head()->parent() == object @@ -521,7 +521,7 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch, || c->head()->path() == path) { c->tail()->disconnected_from(c->head()); c->head()->disconnected_from(c->tail()); - patch->remove_connection(c->tail().get(), c->head().get()); + patch->remove_edge(c->tail().get(), c->head().get()); } } } diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index e52e4eea..df6f63c0 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -53,9 +53,8 @@ PatchModel::remove_child(SharedPtr o) // Remove any connections which referred to this object, // since they can't possibly exist anymore - for (Connections::iterator j = _connections->begin(); - j != _connections->end();) { - Connections::iterator next = j; + for (Edges::iterator j = _edges->begin(); j != _edges->end();) { + Edges::iterator next = j; ++next; SharedPtr cm = PtrCast(j->second); @@ -65,8 +64,8 @@ PatchModel::remove_child(SharedPtr o) || cm->tail_path() == o->path() || cm->head_path().parent() == o->path() || cm->head_path() == o->path()) { - _signal_removed_connection.emit(cm); - _connections->erase(j); // cuts our reference + _signal_removed_edge.emit(cm); + _edges->erase(j); // cuts our reference } j = next; } @@ -85,19 +84,19 @@ PatchModel::remove_child(SharedPtr o) void PatchModel::clear() { - _connections->clear(); + _edges->clear(); NodeModel::clear(); - assert(_connections->empty()); + assert(_edges->empty()); assert(_ports.empty()); } SharedPtr -PatchModel::get_connection(const Port* tail, const Ingen::Port* head) +PatchModel::get_edge(const Port* tail, const Ingen::Port* head) { - Connections::iterator i = _connections->find(make_pair(tail, head)); - if (i != _connections->end()) + Edges::iterator i = _edges->find(make_pair(tail, head)); + if (i != _edges->end()) return PtrCast(i->second); else return SharedPtr(); @@ -111,7 +110,7 @@ PatchModel::get_connection(const Port* tail, const Ingen::Port* head) * this patch is a fatal error. */ void -PatchModel::add_connection(SharedPtr cm) +PatchModel::add_edge(SharedPtr cm) { // Store should have 'resolved' the connection already assert(cm); @@ -125,27 +124,27 @@ PatchModel::add_connection(SharedPtr cm) assert(cm->head()->parent().get() == this || cm->head()->parent()->parent().get() == this); - SharedPtr existing = get_connection( + SharedPtr existing = get_edge( cm->tail().get(), cm->head().get()); if (existing) { assert(cm->tail() == existing->tail()); assert(cm->head() == existing->head()); } else { - _connections->insert(make_pair(make_pair(cm->tail().get(), + _edges->insert(make_pair(make_pair(cm->tail().get(), cm->head().get()), cm)); - _signal_new_connection.emit(cm); + _signal_new_edge.emit(cm); } } void -PatchModel::remove_connection(const Port* tail, const Ingen::Port* head) +PatchModel::remove_edge(const Port* tail, const Ingen::Port* head) { - Connections::iterator i = _connections->find(make_pair(tail, head)); - if (i != _connections->end()) { + Edges::iterator i = _edges->find(make_pair(tail, head)); + if (i != _edges->end()) { SharedPtr c = PtrCast(i->second); - _signal_removed_connection.emit(c); - _connections->erase(i); + _signal_removed_edge.emit(c); + _edges->erase(i); } else { Raul::warn(Raul::fmt("Failed to remove patch connection %1% => %2%\n") % tail->path() % head->path()); -- cgit v1.2.1