diff options
author | Nathan Stewart <therealnathanstewart@gmail.com> | 2016-08-13 16:02:43 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-08-13 16:07:16 +0200 |
commit | 5b4584ad94d3d358c0007ce800c9f3cc80cab4f3 (patch) | |
tree | d7b12ef220297d5fca96f67ac0f8e499b0abd707 /gtk2_ardour/editor_ops.cc | |
parent | 613ae0c110a8d2dad7713514c2810852bc3941e9 (diff) |
Add "Marker Toggle" #5193
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 23 |
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 */ |