summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_grid.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-08 02:10:56 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-08 02:10:56 +0000
commit19e97d1d64e8aa6d87d79d1f6332065992e5e027 (patch)
tree0b68797f47972b13929236b976035ae95f3c1011 /gtk2_ardour/port_matrix_grid.cc
parent9fa8238d9d4ebda14d60cc2256d721a0405b5fa0 (diff)
Attempt to fix some confusions caused by bundles containing
different types of port; if we loop over N MIDI channels of a mixed bundle, for example, we must convert 0...N to the indices of the channels within the bundle. Also remove the hack of creating new bundles to contain a subset of another bundle's ports; if you do this, any signals emitted by the other bundle are ignored. Should fix #4454. git-svn-id: svn://localhost/ardour2/branches/3.0@10490 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_grid.cc')
-rw-r--r--gtk2_ardour/port_matrix_grid.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk2_ardour/port_matrix_grid.cc b/gtk2_ardour/port_matrix_grid.cc
index 67fa73c097..a4ca3df1b8 100644
--- a/gtk2_ardour/port_matrix_grid.cc
+++ b/gtk2_ardour/port_matrix_grid.cc
@@ -191,8 +191,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 */
@@ -328,13 +336,6 @@ PortMatrixGrid::button_press (double x, double y, int b, uint32_t t, guint)
void
PortMatrixGrid::set_association (PortMatrixNode node, bool s)
{
- if (node.row.bundle->nchannels().n_total() == 0 || node.column.bundle->nchannels().n_total() == 0) {
- /* One of the bundles has no channels, which means that it has none of the appropriate type,
- and is only being displayed to look pretty. So we don't need to do anything.
- */
- return;
- }
-
if (_matrix->show_only_bundles()) {
for (uint32_t i = 0; i < node.column.bundle->nchannels().n_total(); ++i) {
@@ -358,6 +359,7 @@ 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);
}
}