From 927b169eb1787bc40ede591c7c7893a39b488d95 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Apr 2012 02:25:35 +0000 Subject: Use "tail" and "head" terminology instead of "src_port" and "dst_port". Use the same types for connect() and disconnect() parameters. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4292 a436a847-0d15-0410-975c-d299462d15a1 --- ingen/client/ClientStore.hpp | 18 ++++---- ingen/client/ConnectionModel.hpp | 67 ----------------------------- ingen/client/EdgeModel.hpp | 67 +++++++++++++++++++++++++++++ ingen/client/PatchModel.hpp | 16 +++---- ingen/client/SigClientInterface.hpp | 10 ++--- ingen/client/ThreadedSigClientInterface.hpp | 10 ++--- 6 files changed, 94 insertions(+), 94 deletions(-) delete mode 100644 ingen/client/ConnectionModel.hpp create mode 100644 ingen/client/EdgeModel.hpp (limited to 'ingen/client') diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index bd009f94..714bdb2d 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -91,13 +91,13 @@ public: const Raul::URI& predicate, const Raul::Atom& value); - void connect(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + void connect(const Raul::Path& tail, + const Raul::Path& head); - void disconnect(const Raul::URI& src, - const Raul::URI& dst); + void disconnect(const Raul::Path& tail, + const Raul::Path& head); - void disconnect_all(const Raul::Path& parent_patch_path, + void disconnect_all(const Raul::Path& parent_patch, const Raul::Path& path); void del(const Raul::URI& uri); @@ -122,15 +122,15 @@ private: void add_plugin(SharedPtr plugin); - SharedPtr connection_patch(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + SharedPtr connection_patch(const Raul::Path& tail_path, + const Raul::Path& head_path); void bundle_begin() {} void bundle_end() {} // Slots for SigClientInterface signals - bool attempt_connection(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + bool attempt_connection(const Raul::Path& tail_path, + const Raul::Path& head_path); SharedPtr _uris; SharedPtr _engine; diff --git a/ingen/client/ConnectionModel.hpp b/ingen/client/ConnectionModel.hpp deleted file mode 100644 index 8fe653c5..00000000 --- a/ingen/client/ConnectionModel.hpp +++ /dev/null @@ -1,67 +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_CONNECTIONMODEL_HPP -#define INGEN_CLIENT_CONNECTIONMODEL_HPP - -#include - -#include "raul/Path.hpp" -#include "raul/SharedPtr.hpp" - -#include "ingen/Connection.hpp" -#include "ingen/client/PortModel.hpp" - -namespace Ingen { -namespace Client { - -class ClientStore; - -/** Class to represent a port->port connections in the engine. - * - * \ingroup IngenClient - */ -class ConnectionModel : public Connection -{ -public: - SharedPtr src_port() const { return _src_port; } - SharedPtr dst_port() const { return _dst_port; } - - const Raul::Path& src_port_path() const { return _src_port->path(); } - const Raul::Path& dst_port_path() const { return _dst_port->path(); } - -private: - friend class ClientStore; - - ConnectionModel(SharedPtr src, SharedPtr dst) - : _src_port(src) - , _dst_port(dst) - { - assert(_src_port); - assert(_dst_port); - assert(_src_port->parent()); - assert(_dst_port->parent()); - assert(_src_port->path() != _dst_port->path()); - } - - const SharedPtr _src_port; - const SharedPtr _dst_port; -}; - -} // namespace Client -} // namespace Ingen - -#endif // INGEN_CLIENT_CONNECTIONMODEL_HPP diff --git a/ingen/client/EdgeModel.hpp b/ingen/client/EdgeModel.hpp new file mode 100644 index 00000000..9b409e92 --- /dev/null +++ b/ingen/client/EdgeModel.hpp @@ -0,0 +1,67 @@ +/* + 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_EDGE_MODEL_HPP +#define INGEN_CLIENT_EDGE_MODEL_HPP + +#include + +#include "raul/Path.hpp" +#include "raul/SharedPtr.hpp" + +#include "ingen/Connection.hpp" +#include "ingen/client/PortModel.hpp" + +namespace Ingen { +namespace Client { + +class ClientStore; + +/** Class to represent a port->port connections in the engine. + * + * \ingroup IngenClient + */ +class EdgeModel : public Connection +{ +public: + SharedPtr tail() const { return _tail; } + SharedPtr head() const { return _head; } + + const Raul::Path& tail_path() const { return _tail->path(); } + const Raul::Path& head_path() const { return _head->path(); } + +private: + friend class ClientStore; + + EdgeModel(SharedPtr tail, SharedPtr head) + : _tail(tail) + , _head(head) + { + assert(_tail); + assert(_head); + assert(_tail->parent()); + assert(_head->parent()); + assert(_tail->path() != _head->path()); + } + + const SharedPtr _tail; + const SharedPtr _head; +}; + +} // namespace Client +} // namespace Ingen + +#endif // INGEN_CLIENT_EDGE_MODEL_HPP diff --git a/ingen/client/PatchModel.hpp b/ingen/client/PatchModel.hpp index 7416aec5..1ea822bb 100644 --- a/ingen/client/PatchModel.hpp +++ b/ingen/client/PatchModel.hpp @@ -29,7 +29,7 @@ class Port; namespace Client { class ClientStore; -class ConnectionModel; +class EdgeModel; /** Client's model of a patch. * @@ -42,8 +42,8 @@ public: const Connections& connections() const { return *_connections.get(); } - SharedPtr get_connection(const Ingen::Port* src_port, - const Ingen::Port* dst_port); + SharedPtr get_connection(const Ingen::Port* tail, + const Ingen::Port* head); bool enabled() const; bool polyphonic() const; @@ -52,8 +52,8 @@ public: // Signals INGEN_SIGNAL(new_node, void, SharedPtr); INGEN_SIGNAL(removed_node, void, SharedPtr); - INGEN_SIGNAL(new_connection, void, SharedPtr); - INGEN_SIGNAL(removed_connection, void, SharedPtr); + INGEN_SIGNAL(new_connection, void, SharedPtr); + INGEN_SIGNAL(removed_connection, void, SharedPtr); private: friend class ClientStore; @@ -68,9 +68,9 @@ private: void add_child(SharedPtr c); bool remove_child(SharedPtr c); - void add_connection(SharedPtr cm); - void remove_connection(const Ingen::Port* src_port, - const Ingen::Port* dst_port); + void add_connection(SharedPtr cm); + void remove_connection(const Ingen::Port* tail, + const Ingen::Port* head); SharedPtr _connections; }; diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp index 3afa6767..5c676efe 100644 --- a/ingen/client/SigClientInterface.hpp +++ b/ingen/client/SigClientInterface.hpp @@ -54,7 +54,7 @@ public: INGEN_SIGNAL(object_moved, void, Raul::Path, Raul::Path) INGEN_SIGNAL(object_deleted, void, Raul::URI) INGEN_SIGNAL(connection, void, Raul::Path, Raul::Path) - INGEN_SIGNAL(disconnection, void, Raul::URI, Raul::URI) + INGEN_SIGNAL(disconnection, void, Raul::Path, Raul::Path) INGEN_SIGNAL(disconnect_all, void, Raul::Path, Raul::Path) INGEN_SIGNAL(variable_change, void, Raul::URI, Raul::URI, Raul::Atom) INGEN_SIGNAL(property_change, void, Raul::URI, Raul::URI, Raul::Atom) @@ -91,8 +91,8 @@ protected: const Resource::Properties& add) { EMIT(delta, uri, remove, add); } - void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) - { EMIT(connection, src_port_path, dst_port_path); } + void connect(const Raul::Path& tail, const Raul::Path& head) + { EMIT(connection, tail, head); } void del(const Raul::URI& uri) { EMIT(object_deleted, uri); } @@ -100,8 +100,8 @@ protected: void move(const Raul::Path& old_path, const Raul::Path& new_path) { EMIT(object_moved, old_path, new_path); } - void disconnect(const Raul::URI& src, const Raul::URI& dst) - { EMIT(disconnection, src, dst); } + 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); } diff --git a/ingen/client/ThreadedSigClientInterface.hpp b/ingen/client/ThreadedSigClientInterface.hpp index c4859e0a..7d70113f 100644 --- a/ingen/client/ThreadedSigClientInterface.hpp +++ b/ingen/client/ThreadedSigClientInterface.hpp @@ -90,8 +90,8 @@ public: const Resource::Properties& add) { push_sig(sigc::bind(delta_slot, path, remove, add)); } - void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) - { push_sig(sigc::bind(connection_slot, src_port_path, dst_port_path)); } + void connect(const Raul::Path& tail, const Raul::Path& head) + { push_sig(sigc::bind(connection_slot, tail, head)); } void del(const Raul::URI& uri) { push_sig(sigc::bind(object_deleted_slot, uri)); } @@ -99,8 +99,8 @@ public: void move(const Raul::Path& old_path, const Raul::Path& new_path) { push_sig(sigc::bind(object_moved_slot, old_path, new_path)); } - void disconnect(const Raul::URI& src, const Raul::URI& dst) - { push_sig(sigc::bind(disconnection_slot, src, dst)); } + 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)); } @@ -132,7 +132,7 @@ private: sigc::slot connection_slot; sigc::slot object_deleted_slot; sigc::slot object_moved_slot; - sigc::slot disconnection_slot; + sigc::slot disconnection_slot; sigc::slot disconnect_all_slot; sigc::slot variable_change_slot; sigc::slot property_change_slot; -- cgit v1.2.1