change Split menu entry to say Split/Separate (it was already doing that anyway). also fix a bug so you can drag the playhead and split at the playhead location

This commit is contained in:
Ben Loftis 2015-01-08 16:00:36 -06:00
parent 5ab70b6822
commit f7e3d1be2c
5 changed files with 19 additions and 10 deletions

View File

@ -184,7 +184,6 @@
<menuitem action='split-region'/>
<menu action="SeparateMenu">
<menuitem action='separate-under-region'/>
<menuitem action='editor-separate'/>
<menuitem action='separate-from-loop'/>
<menuitem action='separate-from-punch'/>
<separator/>

View File

@ -4638,7 +4638,13 @@ Editor::get_preferred_edit_position (bool ignore_playhead, bool from_context_men
switch (ep) {
case EditAtPlayhead:
where = _session->audible_frame();
if (_dragging_playhead) {
if (!mouse_frame (where, ignored)) {
/* XXX not right but what can we do ? */
return 0;
}
} else
where = _session->audible_frame();
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use playhead @ %1\n", where));
break;

View File

@ -1989,7 +1989,7 @@ Editor::register_region_actions ()
reg_sens (_region_actions, "set-region-sync-position", _("Set Sync Position"), sigc::mem_fun (*this, &Editor::set_region_sync_position));
reg_sens (_region_actions, "place-transient", _("Place Transient"), sigc::mem_fun (*this, &Editor::place_transient));
reg_sens (_region_actions, "split-region", _("Split"), sigc::mem_fun (*this, &Editor::split_region));
reg_sens (_region_actions, "split-region", _("Split/Separate"), sigc::mem_fun (*this, &Editor::split_region));
reg_sens (_region_actions, "trim-front", _("Trim Start at Edit Point"), sigc::mem_fun (*this, &Editor::trim_region_front));
reg_sens (_region_actions, "trim-back", _("Trim End at Edit Point"), sigc::mem_fun (*this, &Editor::trim_region_back));

View File

@ -5794,20 +5794,25 @@ Editor::set_playhead_cursor ()
void
Editor::split_region ()
{
//if a range is selected, separate it
if ( !selection->time.empty()) {
separate_regions_between (selection->time);
return;
}
RegionSelection rs = get_regions_from_selection_and_edit_point ();
//if no range was selected, try to find some regions to split
if (current_mouse_mode() == MouseObject) { //don't try this for Internal Edit, Stretch, Draw, etc.
RegionSelection rs = get_regions_from_selection_and_edit_point ();
framepos_t where = get_preferred_edit_position ();
framepos_t where = get_preferred_edit_position ();
if (rs.empty()) {
return;
if (rs.empty()) {
return;
}
split_regions_at (where, rs);
}
split_regions_at (where, rs);
}
struct EditorOrderRouteSorter {

View File

@ -182,7 +182,6 @@ This mode provides many different operations on both regions and control points,
@sess|Common/Save|<@PRIMARY@>s|save session
@sess|Main/Snapshot|<@PRIMARY@><@TERTIARY@>s|snapshot session
@trans|Editor/track-solo-toggle|<@SECONDARY@>s|toggle track solo status
@-group|Editor/editor-separate|<@PRIMARY@><@SECONDARY@>s|some text
@mmode|MouseMode/set-mouse-mode-draw|d|note-draw mode
@rop|Region/duplicate-region|<@SECONDARY@>d|duplicate region (once)
@rop|Region/multi-duplicate-region|<@TERTIARY@>d|duplicate region (multi)