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 --- src/gui/Connection.cpp | 14 +++++++------- src/gui/Connection.hpp | 16 ++++++++-------- src/gui/PatchCanvas.cpp | 46 ++++++++++++++++++++-------------------------- src/gui/PatchCanvas.hpp | 6 +++--- 4 files changed, 38 insertions(+), 44 deletions(-) (limited to 'src/gui') 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); -- cgit v1.2.1