summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_column_labels.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-08-14 18:12:33 +0000
committerCarl Hetherington <carl@carlh.net>2011-08-14 18:12:33 +0000
commitd5a55c48f9027583a0355416e5ef73d6851ff67c (patch)
treec1b29516366b53fde77761065798b19c2656309c /gtk2_ardour/port_matrix_column_labels.cc
parentae5f278202c6a13637644a39c57fe34100cd7f6e (diff)
Fix a few SNAFUs with the port matrix after recent changes.
git-svn-id: svn://localhost/ardour2/branches/3.0@9992 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_column_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_column_labels.cc32
1 files changed, 10 insertions, 22 deletions
diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc
index eba2fffddf..30ff67b9b2 100644
--- a/gtk2_ardour/port_matrix_column_labels.cc
+++ b/gtk2_ardour/port_matrix_column_labels.cc
@@ -133,18 +133,8 @@ PortMatrixColumnLabels::render (cairo_t* cr)
PortGroup::BundleList const & bundles = _matrix->visible_columns()->bundles ();
for (PortGroup::BundleList::const_iterator i = bundles.begin (); i != bundles.end(); ++i) {
- bool should_show_this_bundle = false;
- for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) {
- if (_matrix->should_show ((*i)->bundle->channel_type (j))) {
- should_show_this_bundle = true;
- break;
- }
- }
-
- if (should_show_this_bundle) {
- Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (N);
- render_bundle_name (cr, background_colour (), c, x, 0, (*i)->bundle);
- }
+ Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (N);
+ render_bundle_name (cr, background_colour (), c, x, 0, (*i)->bundle);
if (_matrix->show_only_bundles()) {
x += grid_spacing();
@@ -163,17 +153,18 @@ PortMatrixColumnLabels::render (cairo_t* cr)
for (PortGroup::BundleList::const_iterator i = bundles.begin (); i != bundles.end(); ++i) {
- for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) {
-
- if (!_matrix->should_show ((*i)->bundle->channel_type(j))) {
- continue;
- }
+ uint32_t const C = _matrix->count_of_our_type ((*i)->bundle->nchannels ());
+ for (uint32_t j = 0; j < C; ++j) {
Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (N);
render_channel_name (cr, background_colour (), c, x, 0, ARDOUR::BundleChannel ((*i)->bundle, j));
x += grid_spacing();
}
+ if (C == 0) {
+ x += grid_spacing ();
+ }
+
++N;
}
}
@@ -497,12 +488,9 @@ PortMatrixColumnLabels::motion (double x, double y)
list<PortMatrixNode> n;
- for (uint32_t i = 0; i < w.bundle->nchannels().n_total(); ++i) {
-
- if (!_matrix->should_show (w.bundle->channel_type(i))) {
- continue;
- }
+ uint32_t const N = _matrix->count_of_our_type (w.bundle->nchannels ());
+ for (uint32_t i = 0; i < N; ++i) {
ARDOUR::BundleChannel const bc (w.bundle, i);
n.push_back (PortMatrixNode (ARDOUR::BundleChannel (), bc));
}