X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fport_matrix_grid.cc;h=77995489a313a407aea439a1112337d551877705;hb=0e9dab6aabc2efddc957c7c71bc55354c16626ed;hp=fa394de8ef6860142a0b725599e474ad6b4f8429;hpb=d5a55c48f9027583a0355416e5ef73d6851ff67c;p=ardour.git diff --git a/gtk2_ardour/port_matrix_grid.cc b/gtk2_ardour/port_matrix_grid.cc index fa394de8ef..77995489a3 100644 --- a/gtk2_ardour/port_matrix_grid.cc +++ b/gtk2_ardour/port_matrix_grid.cc @@ -18,9 +18,8 @@ */ #include -#include +#include #include "ardour/bundle.h" -#include "ardour/types.h" #include "port_matrix_grid.h" #include "port_matrix.h" #include "port_matrix_body.h" @@ -138,7 +137,7 @@ PortMatrixGrid::render (cairo_t* cr) cairo_line_to (cr, _width, y); cairo_stroke (cr); } - + /* ASSOCIATION INDICATORS and NON-CONNECTABLE INDICATORS */ /* we draw a grey square in a matrix box if the two ports that intersect at that box @@ -191,8 +190,16 @@ PortMatrixGrid::render (cairo_t* cr) for (uint32_t l = 0; l < _matrix->count_of_our_type ((*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); + + c[_matrix->column_index()] = ARDOUR::BundleChannel ( + (*i)->bundle, + (*i)->bundle->type_channel_to_overall (_matrix->type (), k) + ); + + c[_matrix->row_index()] = ARDOUR::BundleChannel ( + (*j)->bundle, + (*j)->bundle->type_channel_to_overall (_matrix->type (), l) + ); if (c[0].bundle->channel_type (c[0].channel) != c[1].bundle->channel_type (c[1].channel)) { /* these two channels are of different types */ @@ -223,7 +230,7 @@ PortMatrixGrid::render (cairo_t* cr) */ draw_non_connectable_indicator (cr, x, y); } - + x += grid_spacing(); } @@ -304,12 +311,12 @@ PortMatrixGrid::position_to_node (double x, double y) const } void -PortMatrixGrid::button_press (double x, double y, int b, uint32_t t, guint) +PortMatrixGrid::button_press (double x, double y, GdkEventButton* ev) { ARDOUR::BundleChannel const px = position_to_channel (x, y, _matrix->visible_columns()); ARDOUR::BundleChannel const py = position_to_channel (y, x, _matrix->visible_rows()); - if (b == 1) { + if (ev->button == 1) { _dragging = true; _drag_valid = (px.bundle && py.bundle); @@ -318,9 +325,9 @@ PortMatrixGrid::button_press (double x, double y, int b, uint32_t t, guint) _drag_start_x = x / grid_spacing (); _drag_start_y = y / grid_spacing (); - } else if (b == 3) { + } else if (ev->button == 3) { - _matrix->popup_menu (px, py, t); + _matrix->popup_menu (px, py, ev->time); } } @@ -351,15 +358,16 @@ PortMatrixGrid::set_association (PortMatrixNode node, bool s) ARDOUR::BundleChannel c[2]; c[_matrix->row_index()] = node.row; c[_matrix->column_index()] = node.column; + _matrix->set_state (c, s); } } } void -PortMatrixGrid::button_release (double x, double y, int b, uint32_t /*t*/, guint s) +PortMatrixGrid::button_release (double x, double y, GdkEventButton* ev) { - if (b == 1) { + if (ev->button == 1) { if (x != -1) { @@ -378,7 +386,7 @@ PortMatrixGrid::button_release (double x, double y, int b, uint32_t /*t*/, guint } else { - if (Keyboard::modifier_state_equals (s, Keyboard::PrimaryModifier)) { + if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { /* associate/disassociate things diagonally down and right until we run out */ PortMatrixNode::State s = (PortMatrixNode::State) 0; while (1) {