X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fport_matrix_body.cc;h=24fb575d3995af970273b60d68d2ab2576a07100;hb=910cbc600cb11f0554b277cf761811ccf58443a8;hp=73eae929b9d2eacb998c971d46d89ad550e82ac8;hpb=92e412661772e6b9c83109b7ee4996f4c040d3f4;p=ardour.git diff --git a/gtk2_ardour/port_matrix_body.cc b/gtk2_ardour/port_matrix_body.cc index 73eae929b9..24fb575d39 100644 --- a/gtk2_ardour/port_matrix_body.cc +++ b/gtk2_ardour/port_matrix_body.cc @@ -28,7 +28,7 @@ #include "port_matrix_row_labels.h" #include "port_matrix_grid.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; @@ -112,7 +112,7 @@ PortMatrixBody::on_expose_event (GdkEventExpose* event) r.intersect ((*i)->parent_rectangle(), intersects); if (intersects) { - + gdk_draw_drawable ( get_window()->gobj(), get_style()->get_fg_gc (Gtk::STATE_NORMAL)->gobj(), @@ -223,21 +223,21 @@ PortMatrixBody::compute_rectangles () } else if (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM) { col_rect.set_height (min (_alloc_height, col.second)); + row_rect.set_height (std::min (_alloc_height - col_rect.get_height(), row.second)); row_rect.set_x (0); - row_rect.set_y (0); + row_rect.set_y (_alloc_height - row_rect.get_height() - col_rect.get_height()); row_rect.set_width (min (_alloc_width, row.first)); - row_rect.set_height (std::min (_alloc_height - col_rect.get_height(), row.second)); grid_rect.set_x (row_rect.get_width()); - grid_rect.set_y (0); + grid_rect.set_y (_alloc_height - row_rect.get_height() - col_rect.get_height()); grid_rect.set_width (std::min (_alloc_width - row_rect.get_width(), grid.first)); grid_rect.set_height (row_rect.get_height ()); col_rect.set_width (grid_rect.get_width () + col_overhang); col_rect.set_x (row_rect.get_width() + grid_rect.get_width() - col_rect.get_width()); _column_labels_border_x = col_rect.get_x () >= 0 ? col_rect.get_x () : 0; - col_rect.set_y (row_rect.get_height()); + col_rect.set_y (_alloc_height - col_rect.get_height()); } _column_labels_height = col_rect.get_height (); @@ -261,25 +261,25 @@ PortMatrixBody::setup () if (_matrix->visible_rows()) { PortGroup::BundleList r = _matrix->visible_rows()->bundles (); for (PortGroup::BundleList::iterator i = r.begin(); i != r.end(); ++i) { - + (*i)->bundle->Changed.connect (_bundle_connections, invalidator (*this), boost::bind (&PortMatrixBody::rebuild_and_draw_row_labels, this), gui_context()); - + } } - + if (_matrix->visible_columns()) { PortGroup::BundleList c = _matrix->visible_columns()->bundles (); for (PortGroup::BundleList::iterator i = c.begin(); i != c.end(); ++i) { (*i)->bundle->Changed.connect (_bundle_connections, invalidator (*this), boost::bind (&PortMatrixBody::rebuild_and_draw_column_labels, this), gui_context()); } } - + for (list::iterator i = _components.begin(); i != _components.end(); ++i) { (*i)->setup (); } set_mouseover (PortMatrixNode ()); - + _ignore_component_size_changed = true; compute_rectangles (); _ignore_component_size_changed = false; @@ -334,7 +334,7 @@ PortMatrixBody::on_button_press_event (GdkEventButton* ev) (*i)->button_press ( (*i)->parent_to_component_x (ev->x), (*i)->parent_to_component_y (ev->y), - ev->button, ev->time, ev->state + ev ); } } @@ -350,12 +350,12 @@ PortMatrixBody::on_button_release_event (GdkEventButton* ev) (*i)->button_release ( (*i)->parent_to_component_x (ev->x), (*i)->parent_to_component_y (ev->y), - ev->button, ev->time, ev->state + ev ); } else { (*i)->button_release ( -1, -1, - ev->button, ev->time, ev->state + ev ); } } @@ -398,7 +398,7 @@ bool PortMatrixBody::on_motion_notify_event (GdkEventMotion* ev) { bool done = false; - + for (list::iterator i = _components.begin(); i != _components.end(); ++i) { if (Gdk::Region ((*i)->parent_rectangle()).point_in (ev->x, ev->y)) { (*i)->motion ( @@ -409,7 +409,7 @@ PortMatrixBody::on_motion_notify_event (GdkEventMotion* ev) done = true; } } - + if (!done) { set_mouseover (PortMatrixNode ()); @@ -446,7 +446,7 @@ PortMatrixBody::set_mouseover (list const & n) list old = _mouseover; _mouseover = n; - + for (list::iterator i = _components.begin(); i != _components.end(); ++i) { (*i)->mouseover_changed (old); } @@ -458,7 +458,7 @@ PortMatrixBody::highlight_associated_channels (int dim, ARDOUR::BundleChannel h) ARDOUR::BundleChannel bc[2]; bc[dim] = h; - if (!bc[dim].bundle) { + if (!PortMatrix::bundle_with_channels (bc[dim].bundle)) { return; } @@ -476,9 +476,14 @@ PortMatrixBody::highlight_associated_channels (int dim, ARDOUR::BundleChannel h) if (!_matrix->should_show ((*i)->bundle->channel_type(j))) { continue; } - + bc[1 - dim] = ARDOUR::BundleChannel ((*i)->bundle, j); - if (_matrix->get_state (bc) == PortMatrixNode::ASSOCIATED) { + + PortMatrixNode n; + n.row = bc[_matrix->row_index()]; + n.column = bc[_matrix->column_index()]; + + if (_matrix->get_association(n) != PortMatrixNode::NOT_ASSOCIATED) { if (dim == _matrix->column_index()) { _row_labels->add_channel_highlight (bc[1 - dim]); } else { @@ -502,7 +507,7 @@ PortMatrixBody::component_size_changed () if (_ignore_component_size_changed) { return; } - + compute_rectangles (); _matrix->setup_scrollbars (); }