summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_column_labels.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-06-30 02:59:13 +0000
committerCarl Hetherington <carl@carlh.net>2010-06-30 02:59:13 +0000
commit5f67a72c341a96872d9cd3d1de357662295d14b0 (patch)
tree69ac5fad51fc894c0af153121822f479358c57be /gtk2_ardour/port_matrix_column_labels.cc
parent8efaca01efcdb1c7606d3f2aa18e875fd7a26244 (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_column_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_column_labels.cc26
1 files changed, 20 insertions, 6 deletions
diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc
index 339767f27d..fa1989f914 100644
--- a/gtk2_ardour/port_matrix_column_labels.cc
+++ b/gtk2_ardour/port_matrix_column_labels.cc
@@ -62,7 +62,11 @@ PortMatrixColumnLabels::compute_dimensions ()
_longest_bundle_name = ext.width;
}
- for (uint32_t k = 0; k < (*j)->bundle->nchannels (); ++k) {
+ for (uint32_t k = 0; k < (*j)->bundle->nchannels().n_total(); ++k) {
+
+ if ((*j)->bundle->channel_type(k) != _matrix->type()) {
+ continue;
+ }
cairo_text_extents (
cr,
@@ -135,7 +139,7 @@ PortMatrixColumnLabels::render (cairo_t* cr)
if (_matrix->show_only_bundles()) {
x += grid_spacing();
} else {
- x += (*i)->bundle->nchannels () * grid_spacing();
+ x += (*i)->bundle->nchannels().get(_matrix->type()) * grid_spacing();
}
++N;
@@ -149,7 +153,12 @@ PortMatrixColumnLabels::render (cairo_t* cr)
for (PortGroup::BundleList::const_iterator i = bundles.begin (); i != bundles.end(); ++i) {
- for (uint32_t j = 0; j < (*i)->bundle->nchannels(); ++j) {
+ for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) {
+
+ if ((*i)->bundle->channel_type(j) != _matrix->type()) {
+ continue;
+ }
+
Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (N);
render_channel_name (cr, background_colour (), c, x, 0, ARDOUR::BundleChannel ((*i)->bundle, j));
x += grid_spacing();
@@ -254,7 +263,7 @@ PortMatrixColumnLabels::render_bundle_name (
if (_matrix->show_only_bundles()) {
w = grid_spacing ();
} else {
- w = b->nchannels() * grid_spacing();
+ w = b->nchannels().get(_matrix->type()) * grid_spacing();
}
double x_ = xoff;
@@ -352,7 +361,7 @@ PortMatrixColumnLabels::render_channel_name (
);
}
- if (bc.bundle->nchannels() > 1) {
+ if (bc.bundle->nchannels().get(_matrix->type()) > 1) {
/* only plot the name if the bundle has more than one channel;
the name of a single channel is assumed to be redundant */
@@ -478,7 +487,12 @@ PortMatrixColumnLabels::motion (double x, double y)
list<PortMatrixNode> n;
- for (uint32_t i = 0; i < w.bundle->nchannels(); ++i) {
+ for (uint32_t i = 0; i < w.bundle->nchannels().n_total(); ++i) {
+
+ if (w.bundle->channel_type(i) != _matrix->type()) {
+ continue;
+ }
+
ARDOUR::BundleChannel const bc (w.bundle, i);
n.push_back (PortMatrixNode (ARDOUR::BundleChannel (), bc));
}