Add action to create named-range from Selection, and prefer that over the Region variant

* shortcut is currently already assigned to Secondary+Tertiary+R
* perhaps we could instead assign an easier shortcut Primary+M  ?
This commit is contained in:
Ben Loftis 2022-11-08 18:48:21 -06:00
parent 3b49422277
commit bae336129f
4 changed files with 9 additions and 3 deletions

View File

@ -168,7 +168,7 @@ This mode provides many different operations on both regions and control points,
@wvis|Common/show-recorder| <@SECONDARY@>r|show recorder page
@edit|Editor/redo| <@PRIMARY@>r|redo
@edit|Editor/select-from-regions| <@PRIMARY@><@TERTIARY@>r|set Range to selected regions
@rop|Region/add-range-marker-from-region| <@SECONDARY@><@TERTIARY@>r|Add single Range marker from selection
@edit|Editor/add-range-marker-from-selection| <@SECONDARY@><@TERTIARY@>r|Add single Range marker from selection
@trans|Transport/Record| <@TERTIARY@>r|engage record
@mmode|MouseMode/set-mouse-mode-timefx| t|timefx mode
@gselect|Common/select-all-visible-lanes| <@PRIMARY@>t|select all visible lanes

View File

@ -210,6 +210,8 @@
<menuitem action='select-punch-range'/>
<menuitem action='select-from-regions'/>
<separator/>
<menuitem action='add-range-marker-from-selection'/>
<separator/>
<menuitem action='select-all-after-edit-cursor'/>
<menuitem action='select-all-before-edit-cursor'/>
<menuitem action='select-all-between-cursors'/>

View File

@ -402,6 +402,9 @@ Editor::register_actions ()
act = reg_sens (editor_actions, "editor-crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection));
ActionManager::time_selection_sensitive_actions.push_back (act);
act = reg_sens (editor_actions, "add-range-marker-from-selection", _("Add Range Marker from Selection"), sigc::mem_fun(*this, &Editor::add_location_from_selection));
ActionManager::session_sensitive_actions.push_back (act);
act = reg_sens (editor_actions, "editor-consolidate-with-processing", _("Consolidate Range (with processing)"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, true));
ActionManager::time_selection_sensitive_actions.push_back (act);
act = reg_sens (editor_actions, "editor-consolidate", _("Consolidate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, false));

View File

@ -2223,6 +2223,7 @@ Editor::add_location_from_selection ()
string rangename;
if (selection->time.empty()) {
add_location_from_region();
return;
}
@ -2230,8 +2231,8 @@ Editor::add_location_from_selection ()
return;
}
timepos_t start = selection->time[clicked_selection].start();
timepos_t end = selection->time[clicked_selection].end();
timepos_t start = selection->time.start_time();
timepos_t end = selection->time.end_time();
_session->locations()->next_available_name(rangename,"selection");
if (!choose_new_marker_name(rangename, true)) {