+ _grid->mouseover_changed (old);
+ _row_labels->mouseover_changed (old);
+ _column_labels->mouseover_changed (old);
+}
+
+
+
+void
+PortMatrixBody::highlight_associated_channels (int dim, uint32_t N)
+{
+ ARDOUR::BundleChannel bc[2];
+
+ ARDOUR::BundleList const a = _matrix->ports(dim)->bundles ();
+ for (ARDOUR::BundleList::const_iterator i = a.begin(); i != a.end(); ++i) {
+ if (N < (*i)->nchannels ()) {
+ bc[dim] = ARDOUR::BundleChannel (*i, N);
+ break;
+ } else {
+ N -= (*i)->nchannels ();
+ }
+ }
+
+ if (!bc[dim].bundle) {
+ return;
+ }
+
+ if (dim == _matrix->column_index()) {
+ _column_labels->add_channel_highlight (bc[dim]);
+ } else {
+ _row_labels->add_channel_highlight (bc[dim]);
+ }
+
+ ARDOUR::BundleList const b = _matrix->ports(1 - dim)->bundles ();
+
+ for (ARDOUR::BundleList::const_iterator i = b.begin(); i != b.end(); ++i) {
+ for (uint32_t j = 0; j < (*i)->nchannels(); ++j) {
+ bc[1 - dim] = ARDOUR::BundleChannel (*i, j);
+ if (_matrix->get_state (bc) == PortMatrix::ASSOCIATED) {
+ if (dim == _matrix->column_index()) {
+ _row_labels->add_channel_highlight (bc[1 - dim]);
+ } else {
+ _column_labels->add_channel_highlight (bc[1 - dim]);
+ }
+ }
+ }
+ }
+}
+
+void
+PortMatrixBody::set_cairo_clip (cairo_t* cr, Gdk::Rectangle const & r) const
+{
+ cairo_rectangle (cr, r.get_x(), r.get_y(), r.get_width(), r.get_height());
+ cairo_clip (cr);
+}
+
+void
+PortMatrixBody::component_size_changed ()
+{
+ compute_rectangles ();
+ _matrix->setup_scrollbars ();