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 --- ingen/client/BlockModel.hpp | 2 +- ingen/client/ClientStore.hpp | 6 +-- ingen/client/GraphModel.hpp | 72 ++++++++++++++++++++++++++++ ingen/client/ObjectModel.hpp | 2 +- ingen/client/PatchModel.hpp | 74 ----------------------------- ingen/client/PluginModel.hpp | 2 +- ingen/client/SigClientInterface.hpp | 4 +- ingen/client/ThreadedSigClientInterface.hpp | 4 +- 8 files changed, 82 insertions(+), 84 deletions(-) create mode 100644 ingen/client/GraphModel.hpp delete mode 100644 ingen/client/PatchModel.hpp (limited to 'ingen/client') diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index dbb0faf3..d0bae8de 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -48,7 +48,7 @@ public: BlockModel(const BlockModel& copy); virtual ~BlockModel(); - GraphType graph_type() const { return GraphObject::PATCH; } + GraphType graph_type() const { return GraphObject::GRAPH; } typedef std::vector< SharedPtr > Ports; diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 6da7310e..e7e6105b 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -38,8 +38,8 @@ class URIs; namespace Client { class BlockModel; +class GraphModel; class ObjectModel; -class PatchModel; class PluginModel; class PortModel; class SigClientInterface; @@ -94,7 +94,7 @@ public: void disconnect(const Raul::Path& tail, const Raul::Path& head); - void disconnect_all(const Raul::Path& parent_patch, + void disconnect_all(const Raul::Path& graph, const Raul::Path& path); void del(const Raul::URI& uri); @@ -117,7 +117,7 @@ private: void add_plugin(SharedPtr plugin); - SharedPtr connection_patch(const Raul::Path& tail_path, + SharedPtr connection_graph(const Raul::Path& tail_path, const Raul::Path& head_path); void bundle_begin() {} diff --git a/ingen/client/GraphModel.hpp b/ingen/client/GraphModel.hpp new file mode 100644 index 00000000..03a41891 --- /dev/null +++ b/ingen/client/GraphModel.hpp @@ -0,0 +1,72 @@ +/* + This file is part of Ingen. + Copyright 2007-2012 David Robillard + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see . +*/ + +#ifndef INGEN_CLIENT_GRAPHMODEL_HPP +#define INGEN_CLIENT_GRAPHMODEL_HPP + +#include "ingen/client/BlockModel.hpp" +#include "raul/SharedPtr.hpp" + +namespace Ingen { +namespace Client { + +class ClientStore; +class EdgeModel; + +/** Client's model of a graph. + * + * @ingroup IngenClient + */ +class GraphModel : public BlockModel +{ +public: + /* WARNING: Copy constructor creates a shallow copy WRT connections */ + + GraphType graph_type() const { return GraphObject::GRAPH; } + + SharedPtr get_edge(const Ingen::GraphObject* tail, + const Ingen::GraphObject* head); + + bool enabled() const; + bool polyphonic() const; + uint32_t internal_poly() const; + + // Signals + INGEN_SIGNAL(new_block, void, SharedPtr); + INGEN_SIGNAL(removed_block, void, SharedPtr); + INGEN_SIGNAL(new_edge, void, SharedPtr); + INGEN_SIGNAL(removed_edge, void, SharedPtr); + +private: + friend class ClientStore; + + GraphModel(URIs& uris, const Raul::Path& graph_path) + : BlockModel(uris, uris.ingen_Graph, graph_path) + {} + + void clear(); + void add_child(SharedPtr c); + bool remove_child(SharedPtr c); + + void add_edge(SharedPtr cm); + void remove_edge(const Ingen::GraphObject* tail, + const Ingen::GraphObject* head); +}; + +} // namespace Client +} // namespace Ingen + +#endif // INGEN_CLIENT_GRAPHMODEL_HPP diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index b51e82e6..c9f4e6d1 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -41,7 +41,7 @@ namespace Client { class ClientStore; -/** Base class for all GraphObject models (BlockModel, PatchModel, PortModel). +/** Base class for all GraphObject models (BlockModel, GraphModel, PortModel). * * There are no non-const public methods intentionally, models are not allowed * to be manipulated directly by anything (but the Store) because of the diff --git a/ingen/client/PatchModel.hpp b/ingen/client/PatchModel.hpp deleted file mode 100644 index b4f56799..00000000 --- a/ingen/client/PatchModel.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_CLIENT_PATCHMODEL_HPP -#define INGEN_CLIENT_PATCHMODEL_HPP - -#include "ingen/client/BlockModel.hpp" -#include "raul/SharedPtr.hpp" - -namespace Ingen { -namespace Client { - -class ClientStore; -class EdgeModel; - -/** Client's model of a patch. - * - * @ingroup IngenClient - */ -class PatchModel : public BlockModel -{ -public: - /* WARNING: Copy constructor creates a shallow copy WRT connections */ - - GraphType graph_type() const { return GraphObject::PATCH; } - - SharedPtr get_edge(const Ingen::GraphObject* tail, - const Ingen::GraphObject* head); - - bool enabled() const; - bool polyphonic() const; - uint32_t internal_poly() const; - - // Signals - INGEN_SIGNAL(new_block, void, SharedPtr); - INGEN_SIGNAL(removed_block, void, SharedPtr); - INGEN_SIGNAL(new_edge, void, SharedPtr); - INGEN_SIGNAL(removed_edge, void, SharedPtr); - -private: - friend class ClientStore; - - PatchModel(URIs& uris, const Raul::Path& patch_path) - : BlockModel( - uris, Raul::URI("http://drobilla.net/ns/ingen#Patch"), patch_path) - { - } - - void clear(); - void add_child(SharedPtr c); - bool remove_child(SharedPtr c); - - void add_edge(SharedPtr cm); - void remove_edge(const Ingen::GraphObject* tail, - const Ingen::GraphObject* head); -}; - -} // namespace Client -} // namespace Ingen - -#endif // INGEN_CLIENT_PATCHMODEL_HPP diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index 7475e57a..7e082879 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -37,7 +37,7 @@ class URIs; namespace Client { -class PatchModel; +class GraphModel; class BlockModel; class PluginUI; diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp index a330d31e..dc6676f7 100644 --- a/ingen/client/SigClientInterface.hpp +++ b/ingen/client/SigClientInterface.hpp @@ -103,8 +103,8 @@ protected: void disconnect(const Raul::Path& tail, const Raul::Path& head) { EMIT(disconnection, tail, head); } - void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path) - { EMIT(disconnect_all, parent_patch_path, path); } + void disconnect_all(const Raul::Path& graph, const Raul::Path& path) + { EMIT(disconnect_all, graph, path); } void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value) { EMIT(property_change, subject, key, value); } diff --git a/ingen/client/ThreadedSigClientInterface.hpp b/ingen/client/ThreadedSigClientInterface.hpp index 633bd265..a89108bc 100644 --- a/ingen/client/ThreadedSigClientInterface.hpp +++ b/ingen/client/ThreadedSigClientInterface.hpp @@ -101,8 +101,8 @@ public: void disconnect(const Raul::Path& tail, const Raul::Path& head) { push_sig(sigc::bind(disconnection_slot, tail, head)); } - void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path) - { push_sig(sigc::bind(disconnect_all_slot, parent_patch_path, path)); } + void disconnect_all(const Raul::Path& graph, const Raul::Path& path) + { push_sig(sigc::bind(disconnect_all_slot, graph, path)); } void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value) { push_sig(sigc::bind(property_change_slot, subject, key, value)); } -- cgit v1.2.1