now that track and region selections are mutually exclusive, you need a separate action to select-all-tracks and select-all-regions. also, preserve region selection during a split, iff we are working on a region selection: only add the newly created regions, dont change anything else in the selection; leave that in control of the user

This commit is contained in:
Ben Loftis 2014-07-06 12:57:26 -05:00
parent 7d13a49761
commit db60bc86b8
7 changed files with 15 additions and 15 deletions

View file

@ -154,7 +154,8 @@
<menuitem action='editor-paste'/> <menuitem action='editor-paste'/>
<separator/> <separator/>
<menu action="SelectMenu"> <menu action="SelectMenu">
<menuitem action='select-all'/> <menuitem action='select-all-regions'/>
<menuitem action='select-all-tracks'/>
<menuitem action='deselect-all'/> <menuitem action='deselect-all'/>
<menuitem action='invert-selection'/> <menuitem action='invert-selection'/>
<menuitem action='select-all-after-edit-cursor'/> <menuitem action='select-all-after-edit-cursor'/>

View file

@ -1836,7 +1836,7 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
select_menu->set_name ("ArdourContextMenu"); select_menu->set_name ("ArdourContextMenu");
select_items.push_back (MenuElem (_("Select All in Track"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_in_track), Selection::Set))); select_items.push_back (MenuElem (_("Select All in Track"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_in_track), Selection::Set)));
select_items.push_back (MenuElem (_("Select All"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all), Selection::Set))); select_items.push_back (MenuElem (_("Select All Regions"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_regions), Selection::Set)));
select_items.push_back (MenuElem (_("Invert Selection in Track"), sigc::mem_fun(*this, &Editor::invert_selection_in_track))); select_items.push_back (MenuElem (_("Invert Selection in Track"), sigc::mem_fun(*this, &Editor::invert_selection_in_track)));
select_items.push_back (MenuElem (_("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection))); select_items.push_back (MenuElem (_("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection)));
select_items.push_back (SeparatorElem()); select_items.push_back (SeparatorElem());
@ -1913,7 +1913,7 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items)
select_menu->set_name ("ArdourContextMenu"); select_menu->set_name ("ArdourContextMenu");
select_items.push_back (MenuElem (_("Select All in Track"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_in_track), Selection::Set))); select_items.push_back (MenuElem (_("Select All in Track"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_in_track), Selection::Set)));
select_items.push_back (MenuElem (_("Select All"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all), Selection::Set))); select_items.push_back (MenuElem (_("Select All Regions"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_regions), Selection::Set)));
select_items.push_back (MenuElem (_("Invert Selection in Track"), sigc::mem_fun(*this, &Editor::invert_selection_in_track))); select_items.push_back (MenuElem (_("Invert Selection in Track"), sigc::mem_fun(*this, &Editor::invert_selection_in_track)));
select_items.push_back (MenuElem (_("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection))); select_items.push_back (MenuElem (_("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection)));
select_items.push_back (SeparatorElem()); select_items.push_back (SeparatorElem());

View file

@ -251,7 +251,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void maybe_locate_with_edit_preroll (framepos_t); void maybe_locate_with_edit_preroll (framepos_t);
void play_with_preroll (); void play_with_preroll ();
void select_all_in_track (Selection::Operation op); void select_all_in_track (Selection::Operation op);
void select_all (Selection::Operation op); void select_all_regions (Selection::Operation op);
void invert_selection_in_track (); void invert_selection_in_track ();
void invert_selection (); void invert_selection ();
void deselect_all (); void deselect_all ();

View file

@ -191,7 +191,8 @@ Editor::register_actions ()
reg_sens (editor_actions, "playhead-to-range-start", _("Playhead to Range Start"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_selection_start), playhead_cursor)); reg_sens (editor_actions, "playhead-to-range-start", _("Playhead to Range Start"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_selection_start), playhead_cursor));
reg_sens (editor_actions, "playhead-to-range-end", _("Playhead to Range End"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_selection_end), playhead_cursor)); reg_sens (editor_actions, "playhead-to-range-end", _("Playhead to Range End"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_to_selection_end), playhead_cursor));
reg_sens (editor_actions, "select-all", _("Select All"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all), Selection::Set)); reg_sens (editor_actions, "select-all-regions", _("Select All Regions"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_regions), Selection::Set));
reg_sens (editor_actions, "select-all-tracks", _("Select All Tracks"), sigc::mem_fun(*this, &Editor::select_all_tracks));
reg_sens (editor_actions, "deselect-all", _("Deselect All"), sigc::mem_fun(*this, &Editor::deselect_all)); reg_sens (editor_actions, "deselect-all", _("Deselect All"), sigc::mem_fun(*this, &Editor::deselect_all));
reg_sens (editor_actions, "invert-selection", _("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection)); reg_sens (editor_actions, "invert-selection", _("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection));

View file

@ -133,7 +133,7 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
{ {
bool frozen = false; bool frozen = false;
bool operating_on_region_selection = !selection->regions.empty(); RegionSelection pre_selected_regions = selection->regions;
list<boost::shared_ptr<Playlist> > used_playlists; list<boost::shared_ptr<Playlist> > used_playlists;
list<RouteTimeAxisView*> used_trackviews; list<RouteTimeAxisView*> used_trackviews;
@ -234,12 +234,10 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
EditorThaw(); /* Emit Signal */ EditorThaw(); /* Emit Signal */
} }
//IFF we had a selected region, then we should select both sides of the new region after the split. //IFF we were working on selected regions, then we should select both sides of the new region after the split.
//(if there is no region selection then we are working on a range selection, so no changes to region selection are necessary) if( !pre_selected_regions.empty() ) {
if( operating_on_region_selection ) { selection->add (latest_regionviews); //these are the new regions, created after the split
if (!latest_regionviews.empty()) { selection->add (pre_selected_regions); //these were the old selected regions, they got lost in the freeze/thaw
selection->add (latest_regionviews);
}
} }
} }

View file

@ -1370,7 +1370,7 @@ Editor::select_all_internal_edit (Selection::Operation)
} }
void void
Editor::select_all (Selection::Operation op) Editor::select_all_regions (Selection::Operation op)
{ {
list<Selectable *> touched; list<Selectable *> touched;

View file

@ -149,7 +149,7 @@ This mode provides many different operations on both regions and control points,
@trans|Transport/Record|<@TERTIARY@>r|engage record @trans|Transport/Record|<@TERTIARY@>r|engage record
@mmode|MouseMode/set-mouse-mode-timefx|t|timefx mode @mmode|MouseMode/set-mouse-mode-timefx|t|timefx mode
@rop|Region/pitch-shift-region|<@SECONDARY@>t|transpose @rop|Region/pitch-shift-region|<@SECONDARY@>t|transpose
@eep|Editor/insert-time|<@PRIMARY@>t|insert time @eep|Editor/select-all-tracks|<@PRIMARY@>t|select all tracks
@mmode|MouseMode/set-mouse-mode-object-range|y|link object/range tools @mmode|MouseMode/set-mouse-mode-object-range|y|link object/range tools
@edit|Editor/alternate-redo|<@PRIMARY@>y|redo @edit|Editor/alternate-redo|<@PRIMARY@>y|redo
@select|Editor/select-all-between-cursors|<@PRIMARY@>u|all enclosed by edit range @select|Editor/select-all-between-cursors|<@PRIMARY@>u|all enclosed by edit range
@ -174,7 +174,7 @@ This mode provides many different operations on both regions and control points,
;; MIDDLE ROW ;; MIDDLE ROW
@aep|Region/align-regions-sync-relative|a|align sync points (relative) @aep|Region/align-regions-sync-relative|a|align sync points (relative)
@select|Editor/select-all|<@PRIMARY@>a|select everything @select|Editor/select-all-regions|<@PRIMARY@>a|select all regions
@aep|Region/align-regions-end|<@SECONDARY@>a|align end(s) @aep|Region/align-regions-end|<@SECONDARY@>a|align end(s)
@aep|Region/align-regions-sync|<@TERTIARY@>a|align sync points @aep|Region/align-regions-sync|<@TERTIARY@>a|align sync points
@aep|Region/align-regions-start|<@PRIMARY@><@LEVEL4@>a|align start(s) @aep|Region/align-regions-start|<@PRIMARY@><@LEVEL4@>a|align start(s)