summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_row_labels.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-01-27 17:37:07 +0000
committerCarl Hetherington <carl@carlh.net>2009-01-27 17:37:07 +0000
commitb2e163a410a62a20e982b3baac0cf65e611acbce (patch)
tree1e404d3f4f9b33ddde56580d7b4fb02d1432b331 /gtk2_ardour/port_matrix_row_labels.cc
parent9cc7b452ebb8fe8f348ad6aad18054703700da18 (diff)
A few cleanups. Also make port matrix notice when routes or processors change.
git-svn-id: svn://localhost/ardour2/branches/3.0@4447 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_row_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_row_labels.cc22
1 files changed, 6 insertions, 16 deletions
diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc
index 278ae8e003..b938f22a21 100644
--- a/gtk2_ardour/port_matrix_row_labels.cc
+++ b/gtk2_ardour/port_matrix_row_labels.cc
@@ -187,7 +187,7 @@ PortMatrixRowLabels::render (cairo_t* cr)
y = 0;
for (ARDOUR::BundleList::const_iterator i = r.begin(); i != r.end(); ++i) {
for (uint32_t j = 0; j < (*i)->nchannels(); ++j) {
- render_port_name (cr, get_a_bundle_colour (i - r.begin()), port_name_x(), y, PortMatrixBundleChannel (*i, j));
+ render_port_name (cr, get_a_bundle_colour (i - r.begin()), 0, y, PortMatrixBundleChannel (*i, j));
y += row_height();
}
}
@@ -316,11 +316,11 @@ PortMatrixRowLabels::port_name_x () const
void
PortMatrixRowLabels::render_port_name (
- cairo_t* cr, Gdk::Color colour, double x, double y, PortMatrixBundleChannel const& bc
+ cairo_t* cr, Gdk::Color colour, double xoff, double yoff, PortMatrixBundleChannel const& bc
)
{
set_source_rgb (cr, colour);
- cairo_rectangle (cr, x, y, _longest_port_name + name_pad() * 2, row_height());
+ cairo_rectangle (cr, port_name_x() + xoff, yoff, _longest_port_name + name_pad() * 2, row_height());
cairo_fill_preserve (cr);
set_source_rgb (cr, background_colour());
cairo_set_line_width (cr, label_border_width ());
@@ -331,24 +331,14 @@ PortMatrixRowLabels::render_port_name (
double const off = (row_height() - ext.height) / 2;
set_source_rgb (cr, text_colour());
- cairo_move_to (cr, x + name_pad(), y + name_pad() + off);
+ cairo_move_to (cr, port_name_x() + xoff + name_pad(), yoff + name_pad() + off);
cairo_show_text (cr, bc.bundle->channel_name(bc.channel).c_str());
}
double
PortMatrixRowLabels::channel_y (PortMatrixBundleChannel const& bc) const
{
- double y = 0;
-
- ARDOUR::BundleList::const_iterator i = _body->row_ports().bundles().begin();
- while (i != _body->row_ports().bundles().end() && *i != bc.bundle) {
- y += row_height() * (*i)->nchannels();
- ++i;
- }
-
- y += row_height() * bc.channel;
-
- return y;
+ return bc.nchannels (_body->row_ports().bundles()) * row_height();
}
void
@@ -380,7 +370,7 @@ PortMatrixRowLabels::draw_extra (cairo_t* cr)
render_port_name (
cr,
mouseover_port_colour (),
- component_to_parent_x (port_name_x()),
+ component_to_parent_x (0),
component_to_parent_y (channel_y (_body->mouseover().row)),
_body->mouseover().row
);