- for (uint32_t j = 0; j < i->bundle->nchannels(); ++j) {
- Gdk::Color c = i->has_colour ? i->colour : get_a_bundle_colour (M);
- render_channel_name (cr, background_colour (), c, 0, y, ARDOUR::BundleChannel (i->bundle, j));
+ uint32_t const N = _matrix->count_of_our_type ((*i)->bundle->nchannels());
+ for (uint32_t j = 0; j < N; ++j) {
+ Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (M);
+ ARDOUR::BundleChannel bc (
+ (*i)->bundle,
+ (*i)->bundle->type_channel_to_overall (_matrix->type (), j)
+ );
+
+ render_channel_name (cr, background_colour (), c, 0, y, bc);