Sort bundle names in mixer strip menus alphabetically to prevent them being re-ordere...
[ardour.git] / gtk2_ardour / port_matrix_column_labels.cc
index fe5158588f3f4328995068c2e6d0b35352eb8795..ac4e1fef45236355ab4ef23b3a3bfb63c60e965b 100644 (file)
@@ -133,8 +133,18 @@ 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) {
 
-               Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (N);
-               render_bundle_name (cr, background_colour (), c, x, 0, (*i)->bundle);
+               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);
+               }
 
                if (_matrix->show_only_bundles()) {
                        x += grid_spacing();