summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 2741f66d4d..2022216934 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -2243,19 +2243,29 @@ Editor::set_session_end_from_playhead ()
_session->set_end_is_free (false);
}
+
+void
+Editor::toggle_location_at_playhead_cursor ()
+{
+ if (!do_remove_location_at_playhead_cursor())
+ {
+ add_location_from_playhead_cursor();
+ }
+}
+
void
Editor::add_location_from_playhead_cursor ()
{
add_location_mark (_session->audible_frame());
}
-void
-Editor::remove_location_at_playhead_cursor ()
+bool
+Editor::do_remove_location_at_playhead_cursor ()
{
+ bool removed = false;
if (_session) {
//set up for undo
XMLNode &before = _session->locations()->get_state();
- bool removed = false;
//find location(s) at this time
Locations::LocationList locs;
@@ -2275,6 +2285,13 @@ Editor::remove_location_at_playhead_cursor ()
commit_reversible_command ();
}
}
+ return removed;
+}
+
+void
+Editor::remove_location_at_playhead_cursor ()
+{
+ do_remove_location_at_playhead_cursor ();
}
/** Add a range marker around each selected region */