diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index dabbc6f14c..910decc2db 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -583,6 +583,14 @@ ARDOUR_UI::install_dependent_actions () act = ActionManager::register_action (common_actions, "jump-forward-to-mark", _("Jump to Next Mark"), sigc::mem_fun(*editor, &PublicEditor::jump_forward_to_mark)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (common_actions, "jump-backward-to-location-mark", _("Jump to Previous Location Mark"), + sigc::bind (sigc::mem_fun(*editor, &PublicEditor::jump_backward_to_mark_flagged), Location::Flags (0), Location::Flags (0), Location::IsMark)); + ActionManager::session_sensitive_actions.push_back (act); + + act = ActionManager::register_action (common_actions, "jump-forward-to-location-mark", _("Jump to Next Location Mark"), + sigc::bind (sigc::mem_fun(*editor, &PublicEditor::jump_forward_to_mark_flagged), Location::Flags (0), Location::Flags (0), Location::IsMark)); + ActionManager::session_sensitive_actions.push_back (act); + for (int i = 1; i <= 9; ++i) { string const a = string_compose(X_("goto-mark-%1"), i); string const n = string_compose(_("Locate to Mark %1"), i); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index ef861d80ee..30b1c62270 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -740,8 +740,8 @@ private: void update_selection_markers (); void update_section_box (); - void jump_forward_to_mark (); - void jump_backward_to_mark (); + void jump_forward_to_mark_flagged (ARDOUR::Location::Flags, ARDOUR::Location::Flags, ARDOUR::Location::Flags); + void jump_backward_to_mark_flagged (ARDOUR::Location::Flags, ARDOUR::Location::Flags, ARDOUR::Location::Flags); struct LocationMarkers { ArdourMarker* start; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index e8cc160e31..e915256fa4 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2563,13 +2563,13 @@ Editor::add_location_from_region () /* MARKS */ void -Editor::jump_forward_to_mark () +Editor::jump_forward_to_mark_flagged (Location::Flags whitelist, Location::Flags blacklist, Location::Flags equalist) { if (!_session) { return; } - timepos_t pos = _session->locations()->first_mark_after (timepos_t (_session->transport_sample()+1)); + timepos_t pos = _session->locations()->first_mark_after_flagged (timepos_t (_session->transport_sample()+1), true, whitelist, blacklist, equalist); if (pos == timepos_t::max (Temporal::AudioTime)) { return; @@ -2579,13 +2579,13 @@ Editor::jump_forward_to_mark () } void -Editor::jump_backward_to_mark () +Editor::jump_backward_to_mark_flagged (Location::Flags whitelist, Location::Flags blacklist, Location::Flags equalist) { if (!_session) { return; } - timepos_t pos = _session->locations()->first_mark_before (timepos_t (_playhead_cursor->current_sample())); + timepos_t pos = _session->locations()->first_mark_before_flagged (timepos_t (_playhead_cursor->current_sample()), true, whitelist, blacklist, equalist); //handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark... if (_session->transport_rolling()) { diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index c4c2c3d1f5..54ec0573aa 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -266,8 +266,14 @@ public: virtual void set_loop_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd) = 0; virtual void set_punch_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd) = 0; - virtual void jump_forward_to_mark () = 0; - virtual void jump_backward_to_mark () = 0; + void jump_forward_to_mark () { + jump_forward_to_mark_flagged (ARDOUR::Location::Flags (0), ARDOUR::Location::Flags (0), ARDOUR::Location::Flags (0)); + } + void jump_backward_to_mark () { + jump_backward_to_mark_flagged (ARDOUR::Location::Flags (0), ARDOUR::Location::Flags (0), ARDOUR::Location::Flags (0)); + } + virtual void jump_forward_to_mark_flagged (ARDOUR::Location::Flags whitelist, ARDOUR::Location::Flags blacklist, ARDOUR::Location::Flags equalist) = 0; + virtual void jump_backward_to_mark_flagged (ARDOUR::Location::Flags whitelist, ARDOUR::Location::Flags blacklist, ARDOUR::Location::Flags equalist) = 0; virtual void set_session_start_from_playhead () = 0; virtual void set_session_end_from_playhead () = 0;