diff options
author | David Robillard <d@drobilla.net> | 2012-04-28 02:25:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-28 02:25:35 +0000 |
commit | 927b169eb1787bc40ede591c7c7893a39b488d95 (patch) | |
tree | 70337e073d9ddd301e118bbda6b43481e88de4ed | |
parent | eed06c66b6f54687cc148d45d00352a85ad2d3d3 (diff) | |
download | ingen-927b169eb1787bc40ede591c7c7893a39b488d95.tar.gz ingen-927b169eb1787bc40ede591c7c7893a39b488d95.tar.bz2 ingen-927b169eb1787bc40ede591c7c7893a39b488d95.zip |
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
34 files changed, 297 insertions, 303 deletions
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<PluginModel> plugin); - SharedPtr<PatchModel> connection_patch(const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + SharedPtr<PatchModel> 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<Shared::URIs> _uris; SharedPtr<Interface> _engine; diff --git a/ingen/client/ConnectionModel.hpp b/ingen/client/EdgeModel.hpp index 8fe653c5..9b409e92 100644 --- a/ingen/client/ConnectionModel.hpp +++ b/ingen/client/EdgeModel.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_CLIENT_CONNECTIONMODEL_HPP -#define INGEN_CLIENT_CONNECTIONMODEL_HPP +#ifndef INGEN_CLIENT_EDGE_MODEL_HPP +#define INGEN_CLIENT_EDGE_MODEL_HPP #include <cassert> @@ -34,34 +34,34 @@ class ClientStore; * * \ingroup IngenClient */ -class ConnectionModel : public Connection +class EdgeModel : public Connection { public: - SharedPtr<PortModel> src_port() const { return _src_port; } - SharedPtr<PortModel> dst_port() const { return _dst_port; } + SharedPtr<PortModel> tail() const { return _tail; } + SharedPtr<PortModel> head() const { return _head; } - const Raul::Path& src_port_path() const { return _src_port->path(); } - const Raul::Path& dst_port_path() const { return _dst_port->path(); } + const Raul::Path& tail_path() const { return _tail->path(); } + const Raul::Path& head_path() const { return _head->path(); } private: friend class ClientStore; - ConnectionModel(SharedPtr<PortModel> src, SharedPtr<PortModel> dst) - : _src_port(src) - , _dst_port(dst) + EdgeModel(SharedPtr<PortModel> tail, SharedPtr<PortModel> head) + : _tail(tail) + , _head(head) { - assert(_src_port); - assert(_dst_port); - assert(_src_port->parent()); - assert(_dst_port->parent()); - assert(_src_port->path() != _dst_port->path()); + assert(_tail); + assert(_head); + assert(_tail->parent()); + assert(_head->parent()); + assert(_tail->path() != _head->path()); } - const SharedPtr<PortModel> _src_port; - const SharedPtr<PortModel> _dst_port; + const SharedPtr<PortModel> _tail; + const SharedPtr<PortModel> _head; }; } // namespace Client } // namespace Ingen -#endif // INGEN_CLIENT_CONNECTIONMODEL_HPP +#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<ConnectionModel> get_connection(const Ingen::Port* src_port, - const Ingen::Port* dst_port); + SharedPtr<EdgeModel> 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<NodeModel>); INGEN_SIGNAL(removed_node, void, SharedPtr<NodeModel>); - INGEN_SIGNAL(new_connection, void, SharedPtr<ConnectionModel>); - INGEN_SIGNAL(removed_connection, void, SharedPtr<ConnectionModel>); + INGEN_SIGNAL(new_connection, void, SharedPtr<EdgeModel>); + INGEN_SIGNAL(removed_connection, void, SharedPtr<EdgeModel>); private: friend class ClientStore; @@ -68,9 +68,9 @@ private: void add_child(SharedPtr<ObjectModel> c); bool remove_child(SharedPtr<ObjectModel> c); - void add_connection(SharedPtr<ConnectionModel> cm); - void remove_connection(const Ingen::Port* src_port, - const Ingen::Port* dst_port); + void add_connection(SharedPtr<EdgeModel> cm); + void remove_connection(const Ingen::Port* tail, + const Ingen::Port* head); SharedPtr<Connections> _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<void, Raul::Path, Raul::Path> connection_slot; sigc::slot<void, Raul::URI> object_deleted_slot; sigc::slot<void, Raul::Path, Raul::Path> object_moved_slot; - sigc::slot<void, Raul::URI, Raul::URI> disconnection_slot; + sigc::slot<void, Raul::Path, Raul::Path> disconnection_slot; sigc::slot<void, Raul::Path, Raul::Path> disconnect_all_slot; sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> variable_change_slot; sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> 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<PatchModel> -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<PatchModel> patch; - if (src_port_path.parent() == dst_port_path.parent()) - patch = PtrCast<PatchModel>(_object(src_port_path.parent())); + if (tail_path.parent() == head_path.parent()) + patch = PtrCast<PatchModel>(_object(tail_path.parent())); - if (!patch && src_port_path.parent() == dst_port_path.parent().parent()) - patch = PtrCast<PatchModel>(_object(src_port_path.parent())); + if (!patch && tail_path.parent() == head_path.parent().parent()) + patch = PtrCast<PatchModel>(_object(tail_path.parent())); - if (!patch && src_port_path.parent().parent() == dst_port_path.parent()) - patch = PtrCast<PatchModel>(_object(dst_port_path.parent())); + if (!patch && tail_path.parent().parent() == head_path.parent()) + patch = PtrCast<PatchModel>(_object(head_path.parent())); if (!patch) - patch = PtrCast<PatchModel>(_object(src_port_path.parent().parent())); + patch = PtrCast<PatchModel>(_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<PortModel> src_port = PtrCast<PortModel>(_object(src_port_path)); - SharedPtr<PortModel> dst_port = PtrCast<PortModel>(_object(dst_port_path)); + SharedPtr<PortModel> tail = PtrCast<PortModel>(_object(tail_path)); + SharedPtr<PortModel> head = PtrCast<PortModel>(_object(head_path)); - if (src_port && dst_port) { - SharedPtr<PatchModel> patch = connection_patch(src_port_path, dst_port_path); - SharedPtr<ConnectionModel> cm(new ConnectionModel(src_port, dst_port)); + if (tail && head) { + SharedPtr<PatchModel> patch = connection_patch(tail_path, head_path); + SharedPtr<EdgeModel> 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<PortModel> src_port = PtrCast<PortModel>(_object(src_path)); - SharedPtr<PortModel> dst_port = PtrCast<PortModel>(_object(dst_path)); + SharedPtr<PortModel> tail = PtrCast<PortModel>(_object(src_path)); + SharedPtr<PortModel> head = PtrCast<PortModel>(_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<PatchModel> 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<ConnectionModel> c = PtrCast<ConnectionModel>(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<EdgeModel> c = PtrCast<EdgeModel>(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<ObjectModel> o) Connections::iterator next = j; ++next; - SharedPtr<ConnectionModel> cm = PtrCast<ConnectionModel>(j->second); + SharedPtr<EdgeModel> cm = PtrCast<EdgeModel>(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<ConnectionModel> -PatchModel::get_connection(const Port* src_port, const Ingen::Port* dst_port) +SharedPtr<EdgeModel> +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<ConnectionModel>(i->second); + return PtrCast<EdgeModel>(i->second); else - return SharedPtr<ConnectionModel>(); + return SharedPtr<EdgeModel>(); } /** 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<ConnectionModel> cm) +PatchModel::add_connection(SharedPtr<EdgeModel> 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<ConnectionModel> 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<EdgeModel> 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<ConnectionModel> c = PtrCast<ConnectionModel>(i->second); + SharedPtr<EdgeModel> c = PtrCast<EdgeModel>(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<const Client::ConnectionModel> model, - Ganv::Node* src, - Ganv::Node* dst, - uint32_t color) +Connection::Connection(Ganv::Canvas& canvas, + boost::shared_ptr<const Client::EdgeModel> 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<const Client::ConnectionModel> model, - Ganv::Node* src, - Ganv::Node* dst, - uint32_t color); + Connection(Ganv::Canvas& canvas, + boost::shared_ptr<const Client::EdgeModel> model, + Ganv::Node* src, + Ganv::Node* dst, + uint32_t color); - SharedPtr<const Client::ConnectionModel> model() const { return _connection_model; } + SharedPtr<const Client::EdgeModel> model() const { return _edge_model; } private: - SharedPtr<const Client::ConnectionModel> _connection_model; + SharedPtr<const Client::EdgeModel> _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<ConnectionModel>(i->second)); + connection(PtrCast<EdgeModel>(i->second)); } } @@ -473,43 +473,41 @@ PatchCanvas::get_port_view(SharedPtr<PortModel> port) } void -PatchCanvas::connection(SharedPtr<const ConnectionModel> cm) +PatchCanvas::connection(SharedPtr<const EdgeModel> 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<const ConnectionModel> cm) +PatchCanvas::disconnection(SharedPtr<const EdgeModel> 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<Ingen::GUI::Port*>(src_port); + = dynamic_cast<Ingen::GUI::Port*>(tail); const Ingen::GUI::Port* const dst - = dynamic_cast<Ingen::GUI::Port*>(dst_port); + = dynamic_cast<Ingen::GUI::Port*>(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<Ingen::GUI::Port*>(src_port); - - const Ingen::GUI::Port* const dst - = dynamic_cast<Ingen::GUI::Port*>(dst_port); + const Ingen::GUI::Port* const t = dynamic_cast<Ingen::GUI::Port*>(tail); + const Ingen::GUI::Port* const h = dynamic_cast<Ingen::GUI::Port*>(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<const Client::NodeModel> nm); void add_port(SharedPtr<const Client::PortModel> pm); void remove_port(SharedPtr<const Client::PortModel> pm); - void connection(SharedPtr<const Client::ConnectionModel> cm); - void disconnection(SharedPtr<const Client::ConnectionModel> cm); + void connection(SharedPtr<const Client::EdgeModel> cm); + void disconnection(SharedPtr<const Client::EdgeModel> 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<Buffer> 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<Buffer> src_buf = _src_port->buffer(0); + boost::intrusive_ptr<Buffer> 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<boost::intrusive::auto_unlink> > { 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<Buffer> 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<ConnectionImpl> 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<ConnectionImpl> -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<ConnectionImpl> c = PtrCast<ConnectionImpl>(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<ConnectionImpl> c = PtrCast<ConnectionImpl>(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<ConnectionImpl> c); - SharedPtr<ConnectionImpl> remove_connection(const PortImpl* src_port, - const PortImpl* dst_port); + SharedPtr<ConnectionImpl> 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<InputPort*>(dst_port); - _src_output_port = dynamic_cast<OutputPort*>(src_port); + _dst_input_port = dynamic_cast<InputPort*>(head); + _src_output_port = dynamic_cast<OutputPort*>(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<OutputPort*>(_src_port), - dynamic_cast<InputPort*>(_dst_port)); + dynamic_cast<OutputPort*>(_tail), + dynamic_cast<InputPort*>(_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<OutputPort*>((*i)->src_port()), - dynamic_cast<InputPort*>((*i)->dst_port()))); + dynamic_cast<OutputPort*>((*i)->tail()), + dynamic_cast<InputPort*>((*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<const GraphObject> 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 |