From 800c329a0b77f9044923885abe0728028eca8350 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Aug 2012 02:24:38 +0000 Subject: Patch => Graph git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4721 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src/client/ClientStore.cpp') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 07b44b84..6d4cbfd4 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -19,7 +19,7 @@ #include "ingen/client/EdgeModel.hpp" #include "ingen/client/BlockModel.hpp" #include "ingen/client/ObjectModel.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PortModel.hpp" #include "ingen/client/SigClientInterface.hpp" @@ -223,9 +223,9 @@ ClientStore::put(const Raul::URI& uri, std::cerr << "}" << endl; #endif - bool is_patch, is_block, is_port, is_output; + bool is_graph, is_block, is_port, is_output; Resource::type(uris(), properties, - is_patch, is_block, is_port, is_output); + is_graph, is_block, is_port, is_output); // Check if uri is a plugin Iterator t = properties.find(_uris.rdf_type); @@ -233,8 +233,8 @@ ClientStore::put(const Raul::URI& uri, const Raul::Atom& type(t->second); const Raul::URI type_uri(type.get_uri()); const Plugin::Type plugin_type(Plugin::type_from_uri(type_uri)); - if (plugin_type == Plugin::Patch) { - is_patch = true; + if (plugin_type == Plugin::Graph) { + is_graph = true; } else if (plugin_type != Plugin::NIL) { SharedPtr p( new PluginModel(uris(), uri, type_uri, properties)); @@ -258,11 +258,11 @@ ClientStore::put(const Raul::URI& uri, } if (path.is_root()) { - is_patch = true; + is_graph = true; } - if (is_patch) { - SharedPtr model(new PatchModel(uris(), path)); + if (is_graph) { + SharedPtr model(new GraphModel(uris(), path)); model->set_properties(properties); add_object(model); } else if (is_block) { @@ -373,29 +373,29 @@ ClientStore::set_property(const Raul::URI& subject_uri, } } -SharedPtr -ClientStore::connection_patch(const Raul::Path& tail_path, +SharedPtr +ClientStore::connection_graph(const Raul::Path& tail_path, const Raul::Path& head_path) { - SharedPtr patch; + SharedPtr graph; if (tail_path.parent() == head_path.parent()) - patch = PtrCast(_object(tail_path.parent())); + graph = PtrCast(_object(tail_path.parent())); - if (!patch && tail_path.parent() == head_path.parent().parent()) - patch = PtrCast(_object(tail_path.parent())); + if (!graph && tail_path.parent() == head_path.parent().parent()) + graph = PtrCast(_object(tail_path.parent())); - if (!patch && tail_path.parent().parent() == head_path.parent()) - patch = PtrCast(_object(head_path.parent())); + if (!graph && tail_path.parent().parent() == head_path.parent()) + graph = PtrCast(_object(head_path.parent())); - if (!patch) - patch = PtrCast(_object(tail_path.parent().parent())); + if (!graph) + graph = PtrCast(_object(tail_path.parent().parent())); - if (!patch) - _log.error(Raul::fmt("Unable to find path for edge %1% => %2%\n") + if (!graph) + _log.error(Raul::fmt("Unable to find graph for edge %1% => %2%\n") % tail_path % head_path); - return patch; + return graph; } bool @@ -406,13 +406,13 @@ ClientStore::attempt_connection(const Raul::Path& tail_path, SharedPtr head = PtrCast(_object(head_path)); if (tail && head) { - SharedPtr patch = connection_patch(tail_path, head_path); + SharedPtr graph = connection_graph(tail_path, head_path); SharedPtr cm(new EdgeModel(tail, head)); tail->connected_to(head); head->connected_to(tail); - patch->add_edge(cm); + graph->add_edge(cm); return true; } else { _log.warn(Raul::fmt("Failed to connect %1% => %2%\n") @@ -441,26 +441,26 @@ ClientStore::disconnect(const Raul::Path& src_path, if (head) head->disconnected_from(tail); - SharedPtr patch = connection_patch(src_path, dst_path); - if (patch) - patch->remove_edge(tail.get(), head.get()); + SharedPtr graph = connection_graph(src_path, dst_path); + if (graph) + graph->remove_edge(tail.get(), head.get()); } void -ClientStore::disconnect_all(const Raul::Path& parent_patch, +ClientStore::disconnect_all(const Raul::Path& parent_graph, const Raul::Path& path) { - SharedPtr patch = PtrCast(_object(parent_patch)); + SharedPtr graph = PtrCast(_object(parent_graph)); SharedPtr object = _object(path); - if (!patch || !object) { + if (!graph || !object) { _log.error(Raul::fmt("Bad disconnect all notification %1% in %2%\n") - % path % parent_patch); + % path % parent_graph); return; } - const PatchModel::Edges edges = patch->edges(); - for (PatchModel::Edges::const_iterator i = edges.begin(); + const GraphModel::Edges edges = graph->edges(); + for (GraphModel::Edges::const_iterator i = edges.begin(); i != edges.end(); ++i) { SharedPtr c = PtrCast(i->second); if (c->tail()->parent() == object @@ -469,7 +469,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_edge(c->tail().get(), c->head().get()); + graph->remove_edge(c->tail().get(), c->head().get()); } } } -- cgit v1.2.1