diff options
author | Carl Hetherington <carl@carlh.net> | 2010-06-30 02:59:13 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-06-30 02:59:13 +0000 |
commit | 5f67a72c341a96872d9cd3d1de357662295d14b0 (patch) | |
tree | 69ac5fad51fc894c0af153121822f479358c57be /gtk2_ardour/port_matrix_grid.cc | |
parent | 8efaca01efcdb1c7606d3f2aa18e875fd7a26244 (diff) |
Basic tweaks to make the bundles and the port matrix accept that MIDI tracks may have audio IO, and vice versa. Allows connection of instrument tracks using the global port matrix.
git-svn-id: svn://localhost/ardour2/branches/3.0@7335 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_grid.cc')
-rw-r--r-- | gtk2_ardour/port_matrix_grid.cc | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gtk2_ardour/port_matrix_grid.cc b/gtk2_ardour/port_matrix_grid.cc index fdfe45b224..572b278f79 100644 --- a/gtk2_ardour/port_matrix_grid.cc +++ b/gtk2_ardour/port_matrix_grid.cc @@ -81,7 +81,7 @@ PortMatrixGrid::render (cairo_t* cr) if (!_matrix->show_only_bundles()) { cairo_set_line_width (cr, thin_grid_line_width()); - for (uint32_t j = 0; j < (*i)->bundle->nchannels(); ++j) { + for (uint32_t j = 0; j < (*i)->bundle->nchannels().get(_matrix->type()); ++j) { x += grid_spacing (); cairo_move_to (cr, x, 0); cairo_line_to (cr, x, _height); @@ -111,7 +111,7 @@ PortMatrixGrid::render (cairo_t* cr) if (!_matrix->show_only_bundles()) { cairo_set_line_width (cr, thin_grid_line_width()); - for (uint32_t j = 0; j < (*i)->bundle->nchannels(); ++j) { + for (uint32_t j = 0; j < (*i)->bundle->nchannels().get(_matrix->type()); ++j) { y += grid_spacing (); cairo_move_to (cr, 0, y); cairo_line_to (cr, _width, y); @@ -169,10 +169,14 @@ PortMatrixGrid::render (cairo_t* cr) for (PortGroup::BundleList::const_iterator j = row_bundles.begin(); j != row_bundles.end(); ++j) { x = bx; - for (uint32_t k = 0; k < (*i)->bundle->nchannels (); ++k) { + for (uint32_t k = 0; k < (*i)->bundle->nchannels().n_total(); ++k) { y = by; - for (uint32_t l = 0; l < (*j)->bundle->nchannels (); ++l) { + for (uint32_t l = 0; l < (*j)->bundle->nchannels().n_total(); ++l) { + + if ((*i)->bundle->channel_type(k) != _matrix->type() || (*j)->bundle->channel_type(l) != _matrix->type()) { + continue; + } ARDOUR::BundleChannel c[2]; c[_matrix->column_index()] = ARDOUR::BundleChannel ((*i)->bundle, k); @@ -198,10 +202,10 @@ PortMatrixGrid::render (cairo_t* cr) x += grid_spacing(); } - by += (*j)->bundle->nchannels () * grid_spacing(); + by += (*j)->bundle->nchannels().get(_matrix->type()) * grid_spacing(); } - bx += (*i)->bundle->nchannels () * grid_spacing(); + bx += (*i)->bundle->nchannels().get(_matrix->type()) * grid_spacing(); } } } @@ -277,9 +281,13 @@ PortMatrixGrid::get_association (PortMatrixNode node) const bool have_diagonal_association = false; bool have_diagonal_not_association = false; - for (uint32_t i = 0; i < node.row.bundle->nchannels (); ++i) { + for (uint32_t i = 0; i < node.row.bundle->nchannels().n_total(); ++i) { + + for (uint32_t j = 0; j < node.column.bundle->nchannels().n_total(); ++j) { - for (uint32_t j = 0; j < node.column.bundle->nchannels (); ++j) { + if (node.row.bundle->channel_type(i) != _matrix->type() || node.column.bundle->channel_type(j) != _matrix->type()) { + continue; + } ARDOUR::BundleChannel c[2]; c[_matrix->column_index()] = ARDOUR::BundleChannel (node.row.bundle, i); @@ -334,9 +342,13 @@ PortMatrixGrid::set_association (PortMatrixNode node, bool s) { if (_matrix->show_only_bundles()) { - for (uint32_t i = 0; i < node.column.bundle->nchannels(); ++i) { - for (uint32_t j = 0; j < node.row.bundle->nchannels(); ++j) { + for (uint32_t i = 0; i < node.column.bundle->nchannels().n_total(); ++i) { + for (uint32_t j = 0; j < node.row.bundle->nchannels().n_total(); ++j) { + if (node.column.bundle->channel_type(i) != _matrix->type() || node.row.bundle->channel_type(j) != _matrix->type()) { + continue; + } + ARDOUR::BundleChannel c[2]; c[_matrix->column_index()] = ARDOUR::BundleChannel (node.column.bundle, i); c[_matrix->row_index()] = ARDOUR::BundleChannel (node.row.bundle, j); |