diff options
author | David Robillard <d@drobilla.net> | 2012-08-19 02:24:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-19 02:24:38 +0000 |
commit | 800c329a0b77f9044923885abe0728028eca8350 (patch) | |
tree | f2d4a9d06fd6978e193de95ba60bfffe3d15a998 /src/client | |
parent | 317627ef40f7654c298aa1ac707851c852259e3a (diff) | |
download | ingen-800c329a0b77f9044923885abe0728028eca8350.tar.gz ingen-800c329a0b77f9044923885abe0728028eca8350.tar.bz2 ingen-800c329a0b77f9044923885abe0728028eca8350.zip |
Patch => Graph
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4721 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 66 | ||||
-rw-r--r-- | src/client/GraphModel.cpp (renamed from src/client/PatchModel.cpp) | 28 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 2 | ||||
-rw-r--r-- | src/client/wscript | 2 |
4 files changed, 49 insertions, 49 deletions
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<PluginModel> 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<PatchModel> model(new PatchModel(uris(), path)); + if (is_graph) { + SharedPtr<GraphModel> 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<PatchModel> -ClientStore::connection_patch(const Raul::Path& tail_path, +SharedPtr<GraphModel> +ClientStore::connection_graph(const Raul::Path& tail_path, const Raul::Path& head_path) { - SharedPtr<PatchModel> patch; + SharedPtr<GraphModel> graph; if (tail_path.parent() == head_path.parent()) - patch = PtrCast<PatchModel>(_object(tail_path.parent())); + graph = PtrCast<GraphModel>(_object(tail_path.parent())); - if (!patch && tail_path.parent() == head_path.parent().parent()) - patch = PtrCast<PatchModel>(_object(tail_path.parent())); + if (!graph && tail_path.parent() == head_path.parent().parent()) + graph = PtrCast<GraphModel>(_object(tail_path.parent())); - if (!patch && tail_path.parent().parent() == head_path.parent()) - patch = PtrCast<PatchModel>(_object(head_path.parent())); + if (!graph && tail_path.parent().parent() == head_path.parent()) + graph = PtrCast<GraphModel>(_object(head_path.parent())); - if (!patch) - patch = PtrCast<PatchModel>(_object(tail_path.parent().parent())); + if (!graph) + graph = PtrCast<GraphModel>(_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<PortModel> head = PtrCast<PortModel>(_object(head_path)); if (tail && head) { - SharedPtr<PatchModel> patch = connection_patch(tail_path, head_path); + SharedPtr<GraphModel> graph = connection_graph(tail_path, head_path); SharedPtr<EdgeModel> 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<PatchModel> patch = connection_patch(src_path, dst_path); - if (patch) - patch->remove_edge(tail.get(), head.get()); + SharedPtr<GraphModel> 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<PatchModel> patch = PtrCast<PatchModel>(_object(parent_patch)); + SharedPtr<GraphModel> graph = PtrCast<GraphModel>(_object(parent_graph)); SharedPtr<ObjectModel> 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<EdgeModel> c = PtrCast<EdgeModel>(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()); } } } diff --git a/src/client/PatchModel.cpp b/src/client/GraphModel.cpp index 9b622cda..88943978 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/GraphModel.cpp @@ -16,11 +16,11 @@ #include <cassert> +#include "ingen/URIs.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/EdgeModel.hpp" -#include "ingen/client/BlockModel.hpp" -#include "ingen/client/PatchModel.hpp" -#include "ingen/URIs.hpp" +#include "ingen/client/GraphModel.hpp" using namespace std; @@ -28,7 +28,7 @@ namespace Ingen { namespace Client { void -PatchModel::add_child(SharedPtr<ObjectModel> c) +GraphModel::add_child(SharedPtr<ObjectModel> c) { assert(c->parent().get() == this); @@ -45,7 +45,7 @@ PatchModel::add_child(SharedPtr<ObjectModel> c) } bool -PatchModel::remove_child(SharedPtr<ObjectModel> o) +GraphModel::remove_child(SharedPtr<ObjectModel> o) { assert(o->path().is_child_of(path())); assert(o->parent().get() == this); @@ -82,7 +82,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) } void -PatchModel::clear() +GraphModel::clear() { _edges.clear(); @@ -93,7 +93,7 @@ PatchModel::clear() } SharedPtr<EdgeModel> -PatchModel::get_edge(const GraphObject* tail, const GraphObject* head) +GraphModel::get_edge(const GraphObject* tail, const GraphObject* head) { Edges::iterator i = _edges.find(make_pair(tail, head)); if (i != _edges.end()) @@ -102,15 +102,15 @@ PatchModel::get_edge(const GraphObject* tail, const GraphObject* head) return SharedPtr<EdgeModel>(); } -/** Add a connection to this patch. +/** Add a connection to this graph. * * 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. + * this graph is a fatal error. */ void -PatchModel::add_edge(SharedPtr<EdgeModel> cm) +GraphModel::add_edge(SharedPtr<EdgeModel> cm) { // Store should have 'resolved' the connection already assert(cm); @@ -138,7 +138,7 @@ PatchModel::add_edge(SharedPtr<EdgeModel> cm) } void -PatchModel::remove_edge(const GraphObject* tail, const GraphObject* head) +GraphModel::remove_edge(const GraphObject* tail, const GraphObject* head) { Edges::iterator i = _edges.find(make_pair(tail, head)); if (i != _edges.end()) { @@ -149,21 +149,21 @@ PatchModel::remove_edge(const GraphObject* tail, const GraphObject* head) } bool -PatchModel::enabled() const +GraphModel::enabled() const { const Raul::Atom& enabled = get_property(_uris.ingen_enabled); return (enabled.is_valid() && enabled.get_bool()); } uint32_t -PatchModel::internal_poly() const +GraphModel::internal_poly() const { const Raul::Atom& poly = get_property(_uris.ingen_polyphony); return poly.is_valid() ? poly.get_int32() : 1; } bool -PatchModel::polyphonic() const +GraphModel::polyphonic() const { const Raul::Atom& poly = get_property(_uris.ingen_polyphonic); return poly.is_valid() && poly.get_bool(); diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 53736a3e..371e6b46 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -24,7 +24,7 @@ #include "raul/Atom.hpp" #include "raul/Path.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" diff --git a/src/client/wscript b/src/client/wscript index c85ee5ab..c2b12ef3 100644 --- a/src/client/wscript +++ b/src/client/wscript @@ -14,8 +14,8 @@ def build(bld): obj.source = ''' BlockModel.cpp ClientStore.cpp + GraphModel.cpp ObjectModel.cpp - PatchModel.cpp PluginModel.cpp PluginUI.cpp PortModel.cpp |