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/Connection.hpp | 4 +- ingen/Interface.hpp | 10 ++-- 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 ++-- ingen/shared/AtomWriter.hpp | 8 ++-- ingen/shared/ClashAvoider.hpp | 8 ++-- src/client/ClientStore.cpp | 74 ++++++++++++++--------------- src/client/PatchModel.cpp | 62 ++++++++++++------------ src/gui/Connection.cpp | 14 +++--- src/gui/Connection.hpp | 16 +++---- src/gui/PatchCanvas.cpp | 46 ++++++++---------- src/gui/PatchCanvas.hpp | 6 +-- src/serialisation/Serialiser.cpp | 4 +- src/server/ClientBroadcaster.hpp | 12 ++--- src/server/ConnectionImpl.cpp | 58 +++++++++++----------- src/server/ConnectionImpl.hpp | 14 +++--- src/server/InputPort.cpp | 6 +-- src/server/InputPort.hpp | 2 +- src/server/ObjectSender.cpp | 2 +- src/server/PatchImpl.cpp | 14 +++--- src/server/PatchImpl.hpp | 6 +-- src/server/ServerInterfaceImpl.cpp | 10 ++-- src/server/ServerInterfaceImpl.hpp | 8 ++-- src/server/events/Connect.cpp | 24 +++++----- src/server/events/Connect.hpp | 8 ++-- src/server/events/Disconnect.cpp | 36 +++++++------- src/server/events/Disconnect.hpp | 14 +++--- src/server/events/DisconnectAll.cpp | 12 ++--- src/shared/AtomWriter.cpp | 14 +++--- src/shared/Builder.cpp | 2 +- src/shared/ClashAvoider.cpp | 16 +++---- 35 files changed, 346 insertions(+), 352 deletions(-) delete mode 100644 ingen/client/ConnectionModel.hpp create mode 100644 ingen/client/EdgeModel.hpp diff --git a/ingen/Connection.hpp b/ingen/Connection.hpp index 6bb92d3a..7ff34847 100644 --- a/ingen/Connection.hpp +++ b/ingen/Connection.hpp @@ -30,8 +30,8 @@ class Connection public: virtual ~Connection() {} - virtual const Raul::Path& src_port_path() const = 0; - virtual const Raul::Path& dst_port_path() const = 0; + virtual const Raul::Path& tail_path() const = 0; + virtual const Raul::Path& head_path() const = 0; }; } // namespace Ingen diff --git a/ingen/Interface.hpp b/ingen/Interface.hpp index c1472e5e..0a3411a1 100644 --- a/ingen/Interface.hpp +++ b/ingen/Interface.hpp @@ -59,13 +59,13 @@ public: virtual void del(const Raul::URI& uri) = 0; - virtual void connect(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path) = 0; + virtual void connect(const Raul::Path& tail, + const Raul::Path& head) = 0; - virtual void disconnect(const Raul::URI& src, - const Raul::URI& dst) = 0; + virtual void disconnect(const Raul::Path& tail, + const Raul::Path& head) = 0; - virtual void disconnect_all(const Raul::Path& parent_patch_path, + virtual void disconnect_all(const Raul::Path& parent_patch, const Raul::Path& path) = 0; virtual void set_property(const Raul::URI& subject, 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; diff --git a/ingen/shared/AtomWriter.hpp b/ingen/shared/AtomWriter.hpp index a59f11c8..3b70bb89 100644 --- a/ingen/shared/AtomWriter.hpp +++ b/ingen/shared/AtomWriter.hpp @@ -54,11 +54,11 @@ public: void del(const Raul::URI& uri); - 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, const Raul::Path& path); diff --git a/ingen/shared/ClashAvoider.hpp b/ingen/shared/ClashAvoider.hpp index 224eb509..5b62ef53 100644 --- a/ingen/shared/ClashAvoider.hpp +++ b/ingen/shared/ClashAvoider.hpp @@ -63,11 +63,11 @@ public: virtual void move(const Raul::Path& old_path, const Raul::Path& new_path); - virtual void connect(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + virtual void connect(const Raul::Path& tail, + const Raul::Path& head); - virtual void disconnect(const Raul::URI& src, - const Raul::URI& dst); + virtual void disconnect(const Raul::Path& tail, + const Raul::Path& head); virtual void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path); diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 1356e5f7..d56c781d 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -20,7 +20,7 @@ #include "ingen/shared/LV2URIMap.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/ConnectionModel.hpp" +#include "ingen/client/EdgeModel.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/ObjectModel.hpp" #include "ingen/client/PatchModel.hpp" @@ -414,42 +414,42 @@ ClientStore::set_property(const URI& subject_uri, const URI& predicate, const At } SharedPtr -ClientStore::connection_patch(const Path& src_port_path, const Path& dst_port_path) +ClientStore::connection_patch(const Path& tail_path, const Path& head_path) { SharedPtr patch; - if (src_port_path.parent() == dst_port_path.parent()) - patch = PtrCast(_object(src_port_path.parent())); + if (tail_path.parent() == head_path.parent()) + patch = PtrCast(_object(tail_path.parent())); - if (!patch && src_port_path.parent() == dst_port_path.parent().parent()) - patch = PtrCast(_object(src_port_path.parent())); + if (!patch && tail_path.parent() == head_path.parent().parent()) + patch = PtrCast(_object(tail_path.parent())); - if (!patch && src_port_path.parent().parent() == dst_port_path.parent()) - patch = PtrCast(_object(dst_port_path.parent())); + if (!patch && tail_path.parent().parent() == head_path.parent()) + patch = PtrCast(_object(head_path.parent())); if (!patch) - patch = PtrCast(_object(src_port_path.parent().parent())); + patch = PtrCast(_object(tail_path.parent().parent())); if (!patch) - LOG(Raul::error) << "Unable to find connection patch " << src_port_path - << " -> " << dst_port_path << endl; + LOG(Raul::error) << "Unable to find connection patch " << tail_path + << " -> " << head_path << endl; return patch; } bool -ClientStore::attempt_connection(const Path& src_port_path, - const Path& dst_port_path) +ClientStore::attempt_connection(const Path& tail_path, + const Path& head_path) { - SharedPtr src_port = PtrCast(_object(src_port_path)); - SharedPtr dst_port = PtrCast(_object(dst_port_path)); + SharedPtr tail = PtrCast(_object(tail_path)); + SharedPtr head = PtrCast(_object(head_path)); - if (src_port && dst_port) { - SharedPtr patch = connection_patch(src_port_path, dst_port_path); - SharedPtr cm(new ConnectionModel(src_port, dst_port)); + if (tail && head) { + SharedPtr patch = connection_patch(tail_path, head_path); + SharedPtr cm(new EdgeModel(tail, head)); - src_port->connected_to(dst_port); - dst_port->connected_to(src_port); + tail->connected_to(head); + head->connected_to(tail); patch->add_connection(cm); return true; @@ -466,8 +466,8 @@ ClientStore::connect(const Path& src_path, } void -ClientStore::disconnect(const URI& src, - const URI& dst) +ClientStore::disconnect(const Path& src, + const Path& dst) { if (!Path::is_path(src) && !Path::is_path(dst)) { std::cerr << "Bad disconnect notification " << src << " => " << dst << std::endl; @@ -477,18 +477,18 @@ ClientStore::disconnect(const URI& src, const Path src_path(src.str()); const Path dst_path(dst.str()); - SharedPtr src_port = PtrCast(_object(src_path)); - SharedPtr dst_port = PtrCast(_object(dst_path)); + SharedPtr tail = PtrCast(_object(src_path)); + SharedPtr head = PtrCast(_object(dst_path)); - if (src_port) - src_port->disconnected_from(dst_port); + if (tail) + tail->disconnected_from(head); - if (dst_port) - dst_port->disconnected_from(src_port); + if (head) + head->disconnected_from(tail); SharedPtr patch = connection_patch(src_path, dst_path); if (patch) - patch->remove_connection(src_port.get(), dst_port.get()); + patch->remove_connection(tail.get(), head.get()); } void @@ -507,14 +507,14 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch_path, const PatchModel::Connections connections = patch->connections(); for (PatchModel::Connections::const_iterator i = connections.begin(); i != connections.end(); ++i) { - SharedPtr c = PtrCast(i->second); - if (c->src_port()->parent() == object - || c->dst_port()->parent() == object - || c->src_port()->path() == path - || c->dst_port()->path() == path) { - c->src_port()->disconnected_from(c->dst_port()); - c->dst_port()->disconnected_from(c->src_port()); - patch->remove_connection(c->src_port().get(), c->dst_port().get()); + SharedPtr c = PtrCast(i->second); + if (c->tail()->parent() == object + || c->head()->parent() == object + || c->tail()->path() == path + || 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()); } } } diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index f07c64de..ec949429 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -22,7 +22,7 @@ #include "ingen/client/PatchModel.hpp" #include "ingen/client/NodeModel.hpp" -#include "ingen/client/ConnectionModel.hpp" +#include "ingen/client/EdgeModel.hpp" #include "ingen/client/ClientStore.hpp" using namespace std; @@ -59,13 +59,13 @@ PatchModel::remove_child(SharedPtr o) Connections::iterator next = j; ++next; - SharedPtr cm = PtrCast(j->second); + SharedPtr cm = PtrCast(j->second); assert(cm); - if (cm->src_port_path().parent() == o->path() - || cm->src_port_path() == o->path() - || cm->dst_port_path().parent() == o->path() - || cm->dst_port_path() == o->path()) { + if (cm->tail_path().parent() == o->path() + || 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 } @@ -94,14 +94,14 @@ PatchModel::clear() assert(_ports.empty()); } -SharedPtr -PatchModel::get_connection(const Port* src_port, const Ingen::Port* dst_port) +SharedPtr +PatchModel::get_connection(const Port* tail, const Ingen::Port* head) { - Connections::iterator i = _connections->find(make_pair(src_port, dst_port)); + Connections::iterator i = _connections->find(make_pair(tail, head)); if (i != _connections->end()) - return PtrCast(i->second); + return PtrCast(i->second); else - return SharedPtr(); + return SharedPtr(); } /** Add a connection to this patch. @@ -112,43 +112,43 @@ PatchModel::get_connection(const Port* src_port, const Ingen::Port* dst_port) * this patch is a fatal error. */ void -PatchModel::add_connection(SharedPtr cm) +PatchModel::add_connection(SharedPtr cm) { // Store should have 'resolved' the connection already assert(cm); - assert(cm->src_port()); - assert(cm->dst_port()); - assert(cm->src_port()->parent()); - assert(cm->dst_port()->parent()); - assert(cm->src_port_path() != cm->dst_port_path()); - assert(cm->src_port()->parent().get() == this - || cm->src_port()->parent()->parent().get() == this); - assert(cm->dst_port()->parent().get() == this - || cm->dst_port()->parent()->parent().get() == this); - - SharedPtr existing = get_connection( - cm->src_port().get(), cm->dst_port().get()); + assert(cm->tail()); + assert(cm->head()); + assert(cm->tail()->parent()); + assert(cm->head()->parent()); + assert(cm->tail_path() != cm->head_path()); + assert(cm->tail()->parent().get() == this + || cm->tail()->parent()->parent().get() == this); + assert(cm->head()->parent().get() == this + || cm->head()->parent()->parent().get() == this); + + SharedPtr existing = get_connection( + cm->tail().get(), cm->head().get()); if (existing) { - assert(cm->src_port() == existing->src_port()); - assert(cm->dst_port() == existing->dst_port()); + assert(cm->tail() == existing->tail()); + assert(cm->head() == existing->head()); } else { - _connections->insert(make_pair(make_pair(cm->src_port().get(), cm->dst_port().get()), cm)); + _connections->insert(make_pair(make_pair(cm->tail().get(), cm->head().get()), cm)); _signal_new_connection.emit(cm); } } void -PatchModel::remove_connection(const Port* src_port, const Ingen::Port* dst_port) +PatchModel::remove_connection(const Port* tail, const Ingen::Port* head) { - Connections::iterator i = _connections->find(make_pair(src_port, dst_port)); + Connections::iterator i = _connections->find(make_pair(tail, head)); if (i != _connections->end()) { - SharedPtr c = PtrCast(i->second); + SharedPtr c = PtrCast(i->second); _signal_removed_connection.emit(c); _connections->erase(i); } else { warn << "[PatchModel::remove_connection] Failed to find connection " << - src_port->path() << " -> " << dst_port->path() << endl; + tail->path() << " -> " << head->path() << endl; } } diff --git a/src/gui/Connection.cpp b/src/gui/Connection.cpp index 6b29c1d5..0e0093de 100644 --- a/src/gui/Connection.cpp +++ b/src/gui/Connection.cpp @@ -17,20 +17,20 @@ #include "Connection.hpp" #include "Port.hpp" -#include "ingen/client/ConnectionModel.hpp" +#include "ingen/client/EdgeModel.hpp" using namespace std; namespace Ingen { namespace GUI { -Connection::Connection(Ganv::Canvas& canvas, - boost::shared_ptr model, - Ganv::Node* src, - Ganv::Node* dst, - uint32_t color) +Connection::Connection(Ganv::Canvas& canvas, + boost::shared_ptr model, + Ganv::Node* src, + Ganv::Node* dst, + uint32_t color) : Ganv::Edge(canvas, src, dst, color) - , _connection_model(model) + , _edge_model(model) { } diff --git a/src/gui/Connection.hpp b/src/gui/Connection.hpp index 3f2b04a9..17d80bc0 100644 --- a/src/gui/Connection.hpp +++ b/src/gui/Connection.hpp @@ -24,7 +24,7 @@ namespace Ingen { -namespace Client { class ConnectionModel; } +namespace Client { class EdgeModel; } namespace GUI { @@ -35,16 +35,16 @@ namespace GUI { class Connection : public Ganv::Edge { public: - Connection(Ganv::Canvas& canvas, - boost::shared_ptr model, - Ganv::Node* src, - Ganv::Node* dst, - uint32_t color); + Connection(Ganv::Canvas& canvas, + boost::shared_ptr model, + Ganv::Node* src, + Ganv::Node* dst, + uint32_t color); - SharedPtr model() const { return _connection_model; } + SharedPtr model() const { return _edge_model; } private: - SharedPtr _connection_model; + SharedPtr _edge_model; }; } // namespace GUI diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index b322f29f..783896fd 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -305,7 +305,7 @@ PatchCanvas::build() // Create connections for (PatchModel::Connections::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { - connection(PtrCast(i->second)); + connection(PtrCast(i->second)); } } @@ -473,43 +473,41 @@ PatchCanvas::get_port_view(SharedPtr port) } void -PatchCanvas::connection(SharedPtr cm) +PatchCanvas::connection(SharedPtr cm) { - assert(cm); + Ganv::Port* const tail = get_port_view(cm->tail()); + Ganv::Port* const head = get_port_view(cm->head()); - Ganv::Port* const src = get_port_view(cm->src_port()); - Ganv::Port* const dst = get_port_view(cm->dst_port()); - - if (src && dst) { - new GUI::Connection(*this, cm, src, dst, src->get_fill_color()); + if (tail && head) { + new GUI::Connection(*this, cm, tail, head, tail->get_fill_color()); } else { LOG(error) << "Unable to find ports to connect " - << cm->src_port_path() << " -> " << cm->dst_port_path() << endl; + << cm->tail_path() << " -> " << cm->head_path() << endl; } } void -PatchCanvas::disconnection(SharedPtr cm) +PatchCanvas::disconnection(SharedPtr cm) { - Ganv::Port* const src = get_port_view(cm->src_port()); - Ganv::Port* const dst = get_port_view(cm->dst_port()); + Ganv::Port* const src = get_port_view(cm->tail()); + Ganv::Port* const dst = get_port_view(cm->head()); if (src && dst) remove_edge(src, dst); else LOG(error) << "Unable to find ports to disconnect " - << cm->src_port_path() << " -> " << cm->dst_port_path() << endl; + << cm->tail_path() << " -> " << cm->head_path() << endl; } void -PatchCanvas::connect(Ganv::Node* src_port, - Ganv::Node* dst_port) +PatchCanvas::connect(Ganv::Node* tail, + Ganv::Node* head) { const Ingen::GUI::Port* const src - = dynamic_cast(src_port); + = dynamic_cast(tail); const Ingen::GUI::Port* const dst - = dynamic_cast(dst_port); + = dynamic_cast(head); if (!src || !dst) return; @@ -518,17 +516,13 @@ PatchCanvas::connect(Ganv::Node* src_port, } void -PatchCanvas::disconnect(Ganv::Node* src_port, - Ganv::Node* dst_port) +PatchCanvas::disconnect(Ganv::Node* tail, + Ganv::Node* head) { - const Ingen::GUI::Port* const src - = dynamic_cast(src_port); - - const Ingen::GUI::Port* const dst - = dynamic_cast(dst_port); + const Ingen::GUI::Port* const t = dynamic_cast(tail); + const Ingen::GUI::Port* const h = dynamic_cast(head); - _app.engine()->disconnect(src->model()->path(), - dst->model()->path()); + _app.engine()->disconnect(t->model()->path(), h->model()->path()); } void diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index 82827b68..98276d30 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -30,7 +30,7 @@ #include "raul/SharedPtr.hpp" #include "raul/Path.hpp" -#include "ingen/client/ConnectionModel.hpp" +#include "ingen/client/EdgeModel.hpp" #include "ingen/GraphObject.hpp" #include "NodeModule.hpp" @@ -68,8 +68,8 @@ public: void remove_node(SharedPtr nm); void add_port(SharedPtr pm); void remove_port(SharedPtr pm); - void connection(SharedPtr cm); - void disconnection(SharedPtr cm); + void connection(SharedPtr cm); + void disconnection(SharedPtr cm); void get_new_module_location(double& x, double& y); diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index d8978677..e6379e22 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -516,8 +516,8 @@ Serialiser::Impl::serialise_connection(const Sord::Node& parent, Sord::World& world = _model->world(); - const Sord::Node src = path_rdf_node(connection->src_port_path()); - const Sord::Node dst = path_rdf_node(connection->dst_port_path()); + const Sord::Node src = path_rdf_node(connection->tail_path()); + const Sord::Node dst = path_rdf_node(connection->head_path()); const Sord::Node connection_id = Sord::Node::blank_id(*_world.rdf_world()); _model->add_statement(connection_id, Sord::Curie(world, "ingen:tail"), diff --git a/src/server/ClientBroadcaster.hpp b/src/server/ClientBroadcaster.hpp index 3e9b7d0f..c095b960 100644 --- a/src/server/ClientBroadcaster.hpp +++ b/src/server/ClientBroadcaster.hpp @@ -88,14 +88,14 @@ public: BROADCAST(del, uri); } - void connect(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path) { - BROADCAST(connect, src_port_path, dst_port_path); + void connect(const Raul::Path& tail, + const Raul::Path& head) { + BROADCAST(connect, tail, head); } - void disconnect(const Raul::URI& src, - const Raul::URI& dst) { - BROADCAST(disconnect, src, dst); + void disconnect(const Raul::Path& tail, + const Raul::Path& head) { + BROADCAST(disconnect, tail, head); } void disconnect_all(const Raul::Path& parent_patch_path, diff --git a/src/server/ConnectionImpl.cpp b/src/server/ConnectionImpl.cpp index b53f00fe..d233ab5d 100644 --- a/src/server/ConnectionImpl.cpp +++ b/src/server/ConnectionImpl.cpp @@ -44,40 +44,40 @@ namespace Server { * This handles both polyphonic and monophonic nodes, transparently to the * user (InputPort). */ -ConnectionImpl::ConnectionImpl(PortImpl* src_port, PortImpl* dst_port) - : _src_port(src_port) - , _dst_port(dst_port) +ConnectionImpl::ConnectionImpl(PortImpl* tail, PortImpl* head) + : _tail(tail) + , _head(head) , _queue(NULL) { - assert(src_port); - assert(dst_port); - assert(src_port != dst_port); - assert(src_port->path() != dst_port->path()); + assert(tail); + assert(head); + assert(tail != head); + assert(tail->path() != head->path()); if (must_queue()) - _queue = new Raul::RingBuffer(src_port->buffer_size() * 2); + _queue = new Raul::RingBuffer(tail->buffer_size() * 2); } void ConnectionImpl::dump() const { - Raul::debug << _src_port->path() << " -> " << _dst_port->path() + Raul::debug << _tail->path() << " -> " << _head->path() << (must_mix() ? " (MIX) " : " (DIRECT) ") << (must_queue() ? " (QUEUE)" : " (NOQUEUE) ") - << "POLY: " << _src_port->poly() << " => " << _dst_port->poly() + << "POLY: " << _tail->poly() << " => " << _head->poly() << std::endl; } const Raul::Path& -ConnectionImpl::src_port_path() const +ConnectionImpl::tail_path() const { - return _src_port->path(); + return _tail->path(); } const Raul::Path& -ConnectionImpl::dst_port_path() const +ConnectionImpl::head_path() const { - return _dst_port->path(); + return _head->path(); } void @@ -88,21 +88,21 @@ ConnectionImpl::get_sources(Context& context, uint32_t voice, LV2_Atom obj; _queue->peek(sizeof(LV2_Atom), &obj); boost::intrusive_ptr buf = context.engine().buffer_factory()->get( - dst_port()->buffer_type(), sizeof(LV2_Atom) + obj.size); + head()->buffer_type(), sizeof(LV2_Atom) + obj.size); void* data = buf->port_data(PortType::ATOM, context.offset()); _queue->read(sizeof(LV2_Atom) + obj.size, (LV2_Atom*)data); srcs[num_srcs++] = buf; } else if (must_mix()) { // Mixing down voices: every src voice mixed into every dst voice - for (uint32_t v = 0; v < _src_port->poly(); ++v) { + for (uint32_t v = 0; v < _tail->poly(); ++v) { assert(num_srcs < max_num_srcs); - srcs[num_srcs++] = _src_port->buffer(v).get(); + srcs[num_srcs++] = _tail->buffer(v).get(); } } else { // Matching polyphony: each src voice mixed into corresponding dst voice - assert(_src_port->poly() == _dst_port->poly()); + assert(_tail->poly() == _head->poly()); assert(num_srcs < max_num_srcs); - srcs[num_srcs++] = _src_port->buffer(voice).get(); + srcs[num_srcs++] = _tail->buffer(voice).get(); } } @@ -112,9 +112,9 @@ ConnectionImpl::queue(Context& context) if (!must_queue()) return; - const Ingen::Shared::URIs& uris = _src_port->bufs().uris(); + const Ingen::Shared::URIs& uris = _tail->bufs().uris(); - boost::intrusive_ptr src_buf = _src_port->buffer(0); + boost::intrusive_ptr src_buf = _tail->buffer(0); if (src_buf->atom()->type != uris.atom_Sequence) { Raul::error << "Queued connection but source is not a Sequence" << std::endl; return; @@ -124,7 +124,7 @@ ConnectionImpl::queue(Context& context) LV2_ATOM_SEQUENCE_FOREACH(seq, ev) { _queue->write(sizeof(LV2_Atom) + ev->body.size, &ev->body); context.engine().message_context()->run( - _dst_port->parent_node(), context.start() + ev->time.frames); + _head->parent_node(), context.start() + ev->time.frames); } } @@ -134,25 +134,25 @@ ConnectionImpl::buffer(uint32_t voice) const { assert(!must_mix()); assert(!must_queue()); - assert(_src_port->poly() == 1 || _src_port->poly() > voice); - if (_src_port->poly() == 1) { - return _src_port->buffer(0); + assert(_tail->poly() == 1 || _tail->poly() > voice); + if (_tail->poly() == 1) { + return _tail->buffer(0); } else { - return _src_port->buffer(voice); + return _tail->buffer(voice); } } bool ConnectionImpl::must_mix() const { - return _src_port->poly() > _dst_port->poly(); + return _tail->poly() > _head->poly(); } bool ConnectionImpl::must_queue() const { - return _src_port->parent_node()->context() - != _dst_port->parent_node()->context(); + return _tail->parent_node()->context() + != _head->parent_node()->context(); } bool diff --git a/src/server/ConnectionImpl.hpp b/src/server/ConnectionImpl.hpp index 3dc794db..a93674b6 100644 --- a/src/server/ConnectionImpl.hpp +++ b/src/server/ConnectionImpl.hpp @@ -60,13 +60,13 @@ class ConnectionImpl boost::intrusive::link_mode > { public: - ConnectionImpl(PortImpl* src_port, PortImpl* dst_port); + ConnectionImpl(PortImpl* tail, PortImpl* head); - PortImpl* src_port() const { return _src_port; } - PortImpl* dst_port() const { return _dst_port; } + PortImpl* tail() const { return _tail; } + PortImpl* head() const { return _head; } - const Raul::Path& src_port_path() const; - const Raul::Path& dst_port_path() const; + const Raul::Path& tail_path() const; + const Raul::Path& head_path() const; void queue(Context& context); @@ -94,8 +94,8 @@ public: protected: void dump() const; - PortImpl* const _src_port; - PortImpl* const _dst_port; + PortImpl* const _tail; + PortImpl* const _head; Raul::RingBuffer* _queue; }; diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index 30745161..fa76c9b0 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -136,13 +136,13 @@ InputPort::add_connection(ConnectionImpl* c) * will audibly take effect. */ ConnectionImpl* -InputPort::remove_connection(ProcessContext& context, const OutputPort* src_port) +InputPort::remove_connection(ProcessContext& context, const OutputPort* tail) { ThreadManager::assert_thread(THREAD_PROCESS); ConnectionImpl* connection = NULL; for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) { - if (i->src_port() == src_port) { + if (i->tail() == tail) { connection = &*i; _connections.erase(i); break; @@ -192,7 +192,7 @@ InputPort::pre_process(Context& context) uint32_t max_num_srcs = 0; for (Connections::const_iterator c = _connections.begin(); c != _connections.end(); ++c) { - max_num_srcs += c->src_port()->poly(); + max_num_srcs += c->tail()->poly(); } boost::intrusive_ptr srcs[max_num_srcs]; diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index 89f3949a..5d7269da 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -69,7 +69,7 @@ public: void add_connection(ConnectionImpl* c); ConnectionImpl* remove_connection(ProcessContext& context, - const OutputPort* src_port); + const OutputPort* tail); bool apply_poly(Raul::Maid& maid, uint32_t poly); diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp index 96207ebc..4115f2e3 100644 --- a/src/server/ObjectSender.cpp +++ b/src/server/ObjectSender.cpp @@ -88,7 +88,7 @@ ObjectSender::send_patch(Interface* client, const PatchImpl* patch, bool recursi // Send connections for (PatchImpl::Connections::const_iterator j = patch->connections().begin(); j != patch->connections().end(); ++j) - client->connect(j->second->src_port_path(), j->second->dst_port_path()); + client->connect(j->second->tail_path(), j->second->head_path()); } if (bundle) diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 3f8905f1..4fa13a40 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -300,17 +300,17 @@ void PatchImpl::add_connection(SharedPtr c) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - _connections.insert(make_pair(make_pair(c->src_port(), c->dst_port()), c)); + _connections.insert(make_pair(make_pair(c->tail(), c->head()), c)); } /** Remove a connection. * Preprocessing thread only. */ SharedPtr -PatchImpl::remove_connection(const PortImpl* src_port, const PortImpl* dst_port) +PatchImpl::remove_connection(const PortImpl* tail, const PortImpl* dst_port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - Connections::iterator i = _connections.find(make_pair(src_port, dst_port)); + Connections::iterator i = _connections.find(make_pair(tail, dst_port)); if (i != _connections.end()) { SharedPtr c = PtrCast(i->second); _connections.erase(i); @@ -322,10 +322,10 @@ PatchImpl::remove_connection(const PortImpl* src_port, const PortImpl* dst_port) } bool -PatchImpl::has_connection(const PortImpl* src_port, const PortImpl* dst_port) const +PatchImpl::has_connection(const PortImpl* tail, const PortImpl* dst_port) const { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - Connections::const_iterator i = _connections.find(make_pair(src_port, dst_port)); + Connections::const_iterator i = _connections.find(make_pair(tail, dst_port)); return (i != _connections.end()); } @@ -474,8 +474,8 @@ PatchImpl::compile() const for (Connections::const_iterator i = _connections.begin(); i != _connections.end(); ++i) { SharedPtr c = PtrCast(i->second); - if (c->src_port()->parent_node()->context() == Context::AUDIO && - c->dst_port()->parent_node()->context() == Context::MESSAGE) { + if (c->tail()->parent_node()->context() == Context::AUDIO && + c->head()->parent_node()->context() == Context::MESSAGE) { compiled_patch->queued_connections.push_back(c.get()); } } diff --git a/src/server/PatchImpl.hpp b/src/server/PatchImpl.hpp index 124d78a5..85b53351 100644 --- a/src/server/PatchImpl.hpp +++ b/src/server/PatchImpl.hpp @@ -132,10 +132,10 @@ public: void add_connection(SharedPtr c); - SharedPtr remove_connection(const PortImpl* src_port, - const PortImpl* dst_port); + SharedPtr remove_connection(const PortImpl* tail, + const PortImpl* head); - bool has_connection(const PortImpl* src_port, const PortImpl* dst_port) const; + bool has_connection(const PortImpl* tail, const PortImpl* head) const; CompiledPatch* compiled_patch() { return _compiled_patch; } void compiled_patch(CompiledPatch* cp) { _compiled_patch = cp; } diff --git a/src/server/ServerInterfaceImpl.cpp b/src/server/ServerInterfaceImpl.cpp index b2094d9c..3994e695 100644 --- a/src/server/ServerInterfaceImpl.cpp +++ b/src/server/ServerInterfaceImpl.cpp @@ -126,16 +126,16 @@ ServerInterfaceImpl::del(const URI& uri) } void -ServerInterfaceImpl::connect(const Path& src_port_path, - const Path& dst_port_path) +ServerInterfaceImpl::connect(const Path& tail_path, + const Path& head_path) { - push_queued(new Events::Connect(_engine, _request_client, _request_id, now(), src_port_path, dst_port_path)); + push_queued(new Events::Connect(_engine, _request_client, _request_id, now(), tail_path, head_path)); } void -ServerInterfaceImpl::disconnect(const URI& src, - const URI& dst) +ServerInterfaceImpl::disconnect(const Path& src, + const Path& dst) { if (!Path::is_path(src) && !Path::is_path(dst)) { std::cerr << "Bad disconnect request " << src << " => " << dst << std::endl; diff --git a/src/server/ServerInterfaceImpl.hpp b/src/server/ServerInterfaceImpl.hpp index be725cd8..56aea0a3 100644 --- a/src/server/ServerInterfaceImpl.hpp +++ b/src/server/ServerInterfaceImpl.hpp @@ -69,11 +69,11 @@ public: virtual void move(const Raul::Path& old_path, const Raul::Path& new_path); - virtual void connect(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + virtual void connect(const Raul::Path& tail, + const Raul::Path& head); - virtual void disconnect(const Raul::URI& src, - const Raul::URI& dst); + virtual void disconnect(const Raul::Path& tail, + const Raul::Path& head); virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index f61a5cd1..6ad8d4f6 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -46,11 +46,11 @@ Connect::Connect(Engine& engine, Interface* client, int32_t id, SampleCount timestamp, - const Path& src_port_path, - const Path& dst_port_path) + const Path& tail_path, + const Path& head_path) : Event(engine, client, id, timestamp) - , _src_port_path(src_port_path) - , _dst_port_path(dst_port_path) + , _tail_path(tail_path) + , _head_path(head_path) , _patch(NULL) , _src_output_port(NULL) , _dst_input_port(NULL) @@ -63,24 +63,24 @@ Connect::pre_process() { Glib::RWLock::ReaderLock rlock(_engine.engine_store()->lock()); - PortImpl* src_port = _engine.engine_store()->find_port(_src_port_path); - PortImpl* dst_port = _engine.engine_store()->find_port(_dst_port_path); - if (!src_port || !dst_port) { + PortImpl* tail = _engine.engine_store()->find_port(_tail_path); + PortImpl* head = _engine.engine_store()->find_port(_head_path); + if (!tail || !head) { _status = PORT_NOT_FOUND; Event::pre_process(); return; } - _dst_input_port = dynamic_cast(dst_port); - _src_output_port = dynamic_cast(src_port); + _dst_input_port = dynamic_cast(head); + _src_output_port = dynamic_cast(tail); if (!_dst_input_port || !_src_output_port) { _status = DIRECTION_MISMATCH; Event::pre_process(); return; } - NodeImpl* const src_node = src_port->parent_node(); - NodeImpl* const dst_node = dst_port->parent_node(); + NodeImpl* const src_node = tail->parent_node(); + NodeImpl* const dst_node = head->parent_node(); if (!src_node || !dst_node) { _status = PARENT_NOT_FOUND; Event::pre_process(); @@ -176,7 +176,7 @@ Connect::post_process() { respond(_status); if (!_status) { - _engine.broadcaster()->connect(_src_port_path, _dst_port_path); + _engine.broadcaster()->connect(_tail_path, _head_path); } } diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index f4544272..d3c2bea6 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -52,16 +52,16 @@ public: Interface* client, int32_t id, SampleCount timestamp, - const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + const Raul::Path& tail, + const Raul::Path& head); void pre_process(); void execute(ProcessContext& context); void post_process(); private: - Raul::Path _src_port_path; - Raul::Path _dst_port_path; + Raul::Path _tail_path; + Raul::Path _head_path; PatchImpl* _patch; OutputPort* _src_output_port; diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index ddf3bb1c..b6432d0b 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -45,14 +45,14 @@ Disconnect::Disconnect(Engine& engine, Interface* client, int32_t id, SampleCount timestamp, - const Raul::Path& src_port_path, - const Raul::Path& dst_port_path) + const Raul::Path& tail_path, + const Raul::Path& head_path) : Event(engine, client, id, timestamp) - , _src_port_path(src_port_path) - , _dst_port_path(dst_port_path) + , _tail_path(tail_path) + , _head_path(head_path) , _patch(NULL) - , _src_port(NULL) - , _dst_port(NULL) + , _tail(NULL) + , _head(NULL) , _impl(NULL) , _compiled_patch(NULL) { @@ -115,25 +115,25 @@ Disconnect::pre_process() { Glib::RWLock::WriterLock lock(_engine.engine_store()->lock()); - if (_src_port_path.parent().parent() != _dst_port_path.parent().parent() - && _src_port_path.parent() != _dst_port_path.parent().parent() - && _src_port_path.parent().parent() != _dst_port_path.parent()) { + if (_tail_path.parent().parent() != _head_path.parent().parent() + && _tail_path.parent() != _head_path.parent().parent() + && _tail_path.parent().parent() != _head_path.parent()) { _status = PARENT_DIFFERS; Event::pre_process(); return; } - _src_port = _engine.engine_store()->find_port(_src_port_path); - _dst_port = _engine.engine_store()->find_port(_dst_port_path); + _tail = _engine.engine_store()->find_port(_tail_path); + _head = _engine.engine_store()->find_port(_head_path); - if (_src_port == NULL || _dst_port == NULL) { + if (_tail == NULL || _head == NULL) { _status = PORT_NOT_FOUND; Event::pre_process(); return; } - NodeImpl* const src_node = _src_port->parent_node(); - NodeImpl* const dst_node = _dst_port->parent_node(); + NodeImpl* const src_node = _tail->parent_node(); + NodeImpl* const dst_node = _head->parent_node(); // Connection to a patch port from inside the patch if (src_node->parent_patch() != dst_node->parent_patch()) { @@ -155,7 +155,7 @@ Disconnect::pre_process() assert(_patch); - if (!_patch->has_connection(_src_port, _dst_port)) { + if (!_patch->has_connection(_tail, _head)) { _status = NOT_FOUND; Event::pre_process(); return; @@ -169,8 +169,8 @@ Disconnect::pre_process() _impl = new Impl(_engine, _patch, - dynamic_cast(_src_port), - dynamic_cast(_dst_port)); + dynamic_cast(_tail), + dynamic_cast(_head)); if (_patch->enabled()) _compiled_patch = _patch->compile(); @@ -228,7 +228,7 @@ Disconnect::post_process() { respond(_status); if (!_status) { - _engine.broadcaster()->disconnect(_src_port->path(), _dst_port->path()); + _engine.broadcaster()->disconnect(_tail->path(), _head->path()); } delete _impl; diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index 05ac2aa7..cf4e6f18 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -49,8 +49,8 @@ public: Interface* client, int32_t id, SampleCount timestamp, - const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + const Raul::Path& tail_path, + const Raul::Path& head_path); void pre_process(); void execute(ProcessContext& context); @@ -65,7 +65,7 @@ public: bool execute(ProcessContext& context, bool set_dst_buffers); - InputPort* dst_port() { return _dst_input_port; } + InputPort* head() { return _dst_input_port; } private: Engine& _engine; @@ -77,12 +77,12 @@ public: }; private: - const Raul::Path _src_port_path; - const Raul::Path _dst_port_path; + const Raul::Path _tail_path; + const Raul::Path _head_path; PatchImpl* _patch; - PortImpl* _src_port; - PortImpl* _dst_port; + PortImpl* _tail; + PortImpl* _head; Impl* _impl; CompiledPatch* _compiled_patch; diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 08c0a9dc..123b218b 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -125,13 +125,13 @@ DisconnectAll::pre_process() i != _parent->connections().end(); ++i) { ConnectionImpl* const c = (ConnectionImpl*)i->second.get(); if (_node) { - if (c->src_port()->parent_node() == _node - || c->dst_port()->parent_node() == _node) { + if (c->tail()->parent_node() == _node + || c->head()->parent_node() == _node) { to_remove.insert(c); } } else { assert(_port); - if (c->src_port() == _port || c->dst_port() == _port) { + if (c->tail() == _port || c->head() == _port) { to_remove.insert(c); } } @@ -142,8 +142,8 @@ DisconnectAll::pre_process() i != to_remove.end(); ++i) { _impls.push_back(new Disconnect::Impl( _engine, _parent, - dynamic_cast((*i)->src_port()), - dynamic_cast((*i)->dst_port()))); + dynamic_cast((*i)->tail()), + dynamic_cast((*i)->head()))); } if (!_deleting && _parent->enabled()) @@ -160,7 +160,7 @@ DisconnectAll::execute(ProcessContext& context) if (_status == SUCCESS) { for (Impls::iterator i = _impls.begin(); i != _impls.end(); ++i) { (*i)->execute(context, - !_deleting || ((*i)->dst_port()->parent_node() != _node)); + !_deleting || ((*i)->head()->parent_node() != _node)); } } diff --git a/src/shared/AtomWriter.cpp b/src/shared/AtomWriter.cpp index d77364a5..c9af3002 100644 --- a/src/shared/AtomWriter.cpp +++ b/src/shared/AtomWriter.cpp @@ -184,27 +184,27 @@ AtomWriter::del(const Raul::URI& uri) } void -AtomWriter::connect(const Raul::Path& src, - const Raul::Path& dst) +AtomWriter::connect(const Raul::Path& tail, + const Raul::Path& head) { LV2_Atom_Forge_Frame msg; lv2_atom_forge_blank(&_forge, &msg, next_id(), _uris.patch_Put); lv2_atom_forge_property_head(&_forge, _uris.patch_subject, 0); - forge_uri(Raul::Path::lca(src, dst)); + forge_uri(Raul::Path::lca(tail, head)); lv2_atom_forge_property_head(&_forge, _uris.patch_body, 0); - forge_edge(src, dst); + forge_edge(tail, head); lv2_atom_forge_pop(&_forge, &msg); finish_msg(); } void -AtomWriter::disconnect(const Raul::URI& src, - const Raul::URI& dst) +AtomWriter::disconnect(const Raul::Path& tail, + const Raul::Path& head) { LV2_Atom_Forge_Frame msg; lv2_atom_forge_blank(&_forge, &msg, next_id(), _uris.patch_Delete); lv2_atom_forge_property_head(&_forge, _uris.patch_body, 0); - forge_edge(src, dst); + forge_edge(tail, head); lv2_atom_forge_pop(&_forge, &msg); finish_msg(); } diff --git a/src/shared/Builder.cpp b/src/shared/Builder.cpp index 34013a29..e726d647 100644 --- a/src/shared/Builder.cpp +++ b/src/shared/Builder.cpp @@ -88,7 +88,7 @@ Builder::connect(SharedPtr object) if (patch) { for (Patch::Connections::const_iterator i = patch->connections().begin(); i != patch->connections().end(); ++i) { - _interface.connect(i->second->src_port_path(), i->second->dst_port_path()); + _interface.connect(i->second->tail_path(), i->second->head_path()); } return; } diff --git a/src/shared/ClashAvoider.cpp b/src/shared/ClashAvoider.cpp index 7f0bceae..3859ef76 100644 --- a/src/shared/ClashAvoider.cpp +++ b/src/shared/ClashAvoider.cpp @@ -166,24 +166,24 @@ ClashAvoider::move(const Raul::Path& old_path, } void -ClashAvoider::connect(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path) +ClashAvoider::connect(const Raul::Path& tail, + const Raul::Path& head) { - _target.connect(map_path(src_port_path), map_path(dst_port_path)); + _target.connect(map_path(tail), map_path(head)); } void -ClashAvoider::disconnect(const Raul::URI& src, - const Raul::URI& dst) +ClashAvoider::disconnect(const Raul::Path& tail, + const Raul::Path& head) { - _target.disconnect(map_uri(src), map_uri(dst)); + _target.disconnect(map_path(tail), map_path(head)); } void -ClashAvoider::disconnect_all(const Raul::Path& parent_patch_path, +ClashAvoider::disconnect_all(const Raul::Path& parent_patch, const Raul::Path& path) { - _target.disconnect_all(map_path(parent_patch_path), map_path(path)); + _target.disconnect_all(map_path(parent_patch), map_path(path)); } void -- cgit v1.2.1