handle multiple imports of the same file better (via better source naming); make...
[ardour2.git] / gtk2_ardour / port_matrix_labels.cc
blobe2fe306726b66240d4eeae4d61fb672f29c5a557
1 /*
2 Copyright (C) 2002-2009 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "ardour/bundle.h"
21 #include "port_matrix_labels.h"
22 #include "port_matrix.h"
24 void
25 PortMatrixLabels::draw_extra (cairo_t* cr)
27 for (std::vector<ARDOUR::BundleChannel>::const_iterator i = _channel_highlights.begin(); i != _channel_highlights.end(); ++i) {
28 if (_matrix->show_only_bundles()) {
29 render_bundle_name (
30 cr,
31 mouseover_line_colour(),
32 highlighted_channel_colour(),
33 component_to_parent_x (channel_x (*i)),
34 component_to_parent_y (channel_y (*i)),
35 i->bundle
37 } else {
38 render_channel_name (
39 cr,
40 mouseover_line_colour(),
41 highlighted_channel_colour(),
42 component_to_parent_x (channel_x (*i)),
43 component_to_parent_y (channel_y (*i)),
50 void
51 PortMatrixLabels::clear_channel_highlights ()
53 for (std::vector<ARDOUR::BundleChannel>::const_iterator i = _channel_highlights.begin(); i != _channel_highlights.end(); ++i) {
54 queue_draw_for (*i);
57 _channel_highlights.clear ();
60 void
61 PortMatrixLabels::add_channel_highlight (ARDOUR::BundleChannel const & bc)
63 _channel_highlights.push_back (bc);
64 queue_draw_for (bc);