diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index c81b156744..ae0a65b176 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -658,6 +658,9 @@ ARDOUR_UI::install_dependent_actions () act = ActionManager::register_action (common_actions, "alternate-remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(editor, &PublicEditor::remove_location_at_playhead_cursor)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (common_actions, "add-section-from-playhead", _("Add Arrangement Mark at Playhead"), sigc::mem_fun(editor, &PublicEditor::add_section_from_playhead)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (common_actions, "add-bbt-from-playhead", _("Add BBT Marker from Playhead"), sigc::mem_fun(editor, &PublicEditor::add_bbt_marker_at_playhead_cursor)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 468891df07..5575ea82a8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1396,6 +1396,7 @@ private: void add_location_from_region (); void add_locations_from_region (); void add_location_from_selection (); + void add_section_from_playhead (); void set_loop_from_selection (bool play); void set_punch_from_selection (); void set_punch_from_region (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 162e571880..49d9edbc3c 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2144,6 +2144,13 @@ Editor::add_locations_from_region () } } +void +Editor::add_section_from_playhead () +{ + add_location_mark_with_flag (timepos_t (_session->audible_sample()), Location::Flags(Location::IsMark | Location::IsSection), 0); +} + + /** Add a single range marker around all selected regions */ void Editor::add_location_from_region () diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index fc649ada84..9935dd6028 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -200,6 +200,9 @@ Editor::initialize_ruler_actions () _ruler_btn_loc_prev.set_related_action (ActionManager::get_action (X_("Common"), X_("jump-backward-to-mark"))); _ruler_btn_loc_next.set_related_action (ActionManager::get_action (X_("Common"), X_("jump-forward-to-mark"))); _ruler_btn_loc_add.set_related_action (ActionManager::get_action (X_("Common"), X_("add-location-from-playhead"))); + + _ruler_btn_section_add.set_related_action (ActionManager::get_action (X_("Common"), X_("add-section-from-playhead"))); + } bool diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 41802c9d8d..1987b76ba6 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -185,6 +185,7 @@ public: virtual void trigger_script (int nth) = 0; virtual void add_bbt_marker_at_playhead_cursor () = 0; virtual void add_location_from_playhead_cursor () = 0; + virtual void add_section_from_playhead () = 0; virtual void remove_location_at_playhead_cursor () = 0; void add_location_mark (Temporal::timepos_t const & where, ARDOUR::Location::Flags flags = ARDOUR::Location::IsMark, int32_t cue_id = 0) { add_location_mark_with_flag (where, flags, cue_id);