summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-10 18:29:32 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-10 18:29:32 +0000
commitba8b84eed159b5c6282b176ccd488134a9ea5b72 (patch)
tree1e439936e007d6da7aa190b33a28b9fadff559e1 /gtk2_ardour/editor_markers.cc
parent4d5f26902dd366cfde94ce6d3006cb8ea247a061 (diff)
Option to show lines below markers (#3529).
git-svn-id: svn://localhost/ardour2/branches/3.0@7993 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc70
1 files changed, 59 insertions, 11 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 053080fb49..0eab51260f 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -145,6 +145,12 @@ Editor::add_new_location (Location *location)
selection->set (lam->start);
select_new_marker = false;
}
+
+ if (_show_marker_lines) {
+ lam->show_lines (cursor_group, _canvas_height);
+ } else {
+ lam->hide_lines ();
+ }
}
void
@@ -356,14 +362,48 @@ void
Editor::LocationMarkers::hide()
{
start->hide ();
- if (end) { end->hide(); }
+ if (end) {
+ end->hide ();
+ }
}
void
Editor::LocationMarkers::show()
{
start->show ();
- if (end) { end->show(); }
+ if (end) {
+ end->show ();
+ }
+}
+
+void
+Editor::LocationMarkers::show_lines (ArdourCanvas::Group* g, double h)
+{
+ /* add_line may be required, and it calls show_line even if it isn't */
+
+ start->add_line (g, 0, h);
+
+ if (end) {
+ end->add_line (g, 0, h);
+ }
+}
+
+void
+Editor::LocationMarkers::hide_lines ()
+{
+ start->hide_line ();
+ if (end) {
+ end->hide_line ();
+ }
+}
+
+void
+Editor::LocationMarkers::set_lines_vpos (double y, double h)
+{
+ start->set_line_vpos (y, h);
+ if (end) {
+ end->set_line_vpos (y, h);
+ }
}
void
@@ -1203,15 +1243,9 @@ Editor::marker_selection_changed ()
return;
}
- for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
- LocationMarkers* lam = i->second;
-
- if (lam->start) {
- lam->start->hide_line();
- }
-
- if (lam->end) {
- lam->end->hide_line();
+ if (!_show_marker_lines) {
+ for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
+ i->second->hide_lines ();
}
}
@@ -1277,3 +1311,17 @@ Editor::toggle_marker_menu_glue ()
}
}
+
+void
+Editor::toggle_marker_lines ()
+{
+ _show_marker_lines = !_show_marker_lines;
+
+ for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
+ if (_show_marker_lines) {
+ i->second->show_lines (cursor_group, _canvas_height);
+ } else {
+ i->second->hide_lines ();
+ }
+ }
+}