- if (i < (_body->row_bundles().size() - 1)) {
- y += row_height();
- cairo_set_line_width (cr, thick_grid_line_width());
- cairo_move_to (cr, 0, y);
- cairo_line_to (cr, grid_width, y);
- cairo_stroke (cr);
+ for (PortGroup::BundleList::const_iterator i = column_bundles.begin(); i != column_bundles.end(); ++i) {
+ by = y;
+
+ for (PortGroup::BundleList::const_iterator j = row_bundles.begin(); j != row_bundles.end(); ++j) {
+
+ PortMatrixNode::State s = get_association (PortMatrixNode (
+ ARDOUR::BundleChannel (i->bundle, 0),
+ ARDOUR::BundleChannel (j->bundle, 0)
+ ));
+ switch (s) {
+ case PortMatrixNode::UNKNOWN:
+ draw_unknown_indicator (cr, bx, by);
+ break;
+ case PortMatrixNode::ASSOCIATED:
+ draw_association_indicator (cr, bx, by);
+ break;
+ case PortMatrixNode::PARTIAL:
+ draw_association_indicator (cr, bx, by, 0.5);
+ break;
+ default:
+ break;
+ }
+
+ by += grid_spacing();
+ }
+
+ bx += grid_spacing();
+
+ }
+
+ } else {
+
+ for (PortGroup::BundleList::const_iterator i = column_bundles.begin(); i != column_bundles.end(); ++i) {
+ by = y;
+
+ for (PortGroup::BundleList::const_iterator j = row_bundles.begin(); j != row_bundles.end(); ++j) {
+
+ tx = bx;
+ for (uint32_t k = 0; k < i->bundle->nchannels (); ++k) {
+
+ ty = by;
+ for (uint32_t l = 0; l < j->bundle->nchannels (); ++l) {
+
+ ARDOUR::BundleChannel c[2];
+ c[_matrix->column_index()] = ARDOUR::BundleChannel (i->bundle, k);
+ c[_matrix->row_index()] = ARDOUR::BundleChannel (j->bundle, l);
+
+ PortMatrixNode::State const s = _matrix->get_state (c);
+
+ switch (s) {
+ case PortMatrixNode::ASSOCIATED:
+ draw_association_indicator (cr, tx, ty);
+ break;
+
+ case PortMatrixNode::UNKNOWN:
+ draw_unknown_indicator (cr, tx, ty);
+ break;
+
+ case PortMatrixNode::NOT_ASSOCIATED:
+ break;
+
+ default:
+ break;
+ }
+
+ ty += grid_spacing();
+ }
+
+ tx += grid_spacing();
+ }
+
+ by += j->bundle->nchannels () * grid_spacing();
+ }
+
+ bx += i->bundle->nchannels () * grid_spacing();