From 49510ba1d7fc1c85e767c05f10f9481998ef94b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 25 Jan 2009 06:47:11 +0000 Subject: Some refactoring. Add port group headers to the port matrix. git-svn-id: svn://localhost/ardour2/branches/3.0@4443 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix_body.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'gtk2_ardour/port_matrix_body.cc') diff --git a/gtk2_ardour/port_matrix_body.cc b/gtk2_ardour/port_matrix_body.cc index d9d8013578..3531712a56 100644 --- a/gtk2_ardour/port_matrix_body.cc +++ b/gtk2_ardour/port_matrix_body.cc @@ -19,6 +19,7 @@ #include #include "ardour/bundle.h" +#include "ardour/types.h" #include "port_matrix_body.h" #include "port_matrix.h" @@ -29,7 +30,9 @@ PortMatrixBody::PortMatrixBody (PortMatrix* p, Arrangement a) _grid (p, this), _arrangement (a), _xoffset (0), - _yoffset (0) + _yoffset (0), + _column_ports (_port_matrix->type(), _port_matrix->offering_input()), + _row_ports (_port_matrix->type(), !_port_matrix->offering_input()) { modify_bg (Gtk::STATE_NORMAL, Gdk::Color ("#00000")); } @@ -215,10 +218,7 @@ PortMatrixBody::compute_rectangles () } void -PortMatrixBody::setup ( - std::vector > const & row, - std::vector > const & column - ) +PortMatrixBody::setup (PortGroupList const& row, PortGroupList const& column) { for (std::list::iterator i = _bundle_connections.begin(); i != _bundle_connections.end(); ++i) { i->disconnect (); @@ -226,10 +226,11 @@ PortMatrixBody::setup ( _bundle_connections.clear (); - _row_bundles = row; - _column_bundles = column; + _row_ports = row; + _column_ports = column; - for (std::vector >::iterator i = _row_bundles.begin(); i != _row_bundles.end(); ++i) { + ARDOUR::BundleList r = _row_ports.bundles (); + for (ARDOUR::BundleList::iterator i = r.begin(); i != r.end(); ++i) { _bundle_connections.push_back ( (*i)->NameChanged.connect (sigc::mem_fun (*this, &PortMatrixBody::rebuild_and_draw_row_labels)) @@ -237,7 +238,8 @@ PortMatrixBody::setup ( } - for (std::vector >::iterator i = _column_bundles.begin(); i != _column_bundles.end(); ++i) { + ARDOUR::BundleList c = _column_ports.bundles (); + for (ARDOUR::BundleList::iterator i = c.begin(); i != c.end(); ++i) { _bundle_connections.push_back ( (*i)->NameChanged.connect (sigc::mem_fun (*this, &PortMatrixBody::rebuild_and_draw_column_labels)) ); -- cgit v1.2.3