diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2014-07-03 17:50:14 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2014-07-03 17:50:14 -0500 |
commit | 555a5d6348d544a86fe9df1410db8a549ba05c5f (patch) | |
tree | 5875c533e88905d6080534fb5df09ab1b308e96d /gtk2_ardour/editor_ops.cc | |
parent | ba33c6dab6c6c41cb3392e06b824f4b46e3debf1 (diff) |
lots of keybinding changes. added a new action to allow removing markers at the playhead location. numpad now allows you to access marks higher than 9. to locate to a marker, use the numpad decimal to start and end the operation - for example press .19. to locate to marker 19. also added alternate bindings for redo, delete, and several other alternates that will be needed in subsequent commits. tab is not working, using either Tab or nabla in the binding.in file
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 3c89ddc448..7489199504 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1892,6 +1892,35 @@ Editor::add_location_from_playhead_cursor () add_location_mark (_session->audible_frame()); } +void +Editor::remove_location_at_playhead_cursor () +{ + if (_session) { + + //set up for undo + _session->begin_reversible_command (_("remove marker")); + XMLNode &before = _session->locations()->get_state(); + bool removed = false; + + //find location(s) at this time + Locations::LocationList locs; + _session->locations()->find_all_between (_session->audible_frame(), _session->audible_frame()+1, locs, Location::Flags(0)); + for (Locations::LocationList::iterator i = locs.begin(); i != locs.end(); ++i) { + if ((*i)->is_mark()) { + _session->locations()->remove (*i); + removed = true; + } + } + + //store undo + if (removed) { + XMLNode &after = _session->locations()->get_state(); + _session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after)); + _session->commit_reversible_command (); + } + } +} + /** Add a range marker around each selected region */ void Editor::add_locations_from_region () |