From db60bc86b8cbcee44e333047346714bd138b1ca6 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Sun, 6 Jul 2014 12:57:26 -0500 Subject: 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 --- gtk2_ardour/ardour.menus.in | 3 ++- gtk2_ardour/editor.cc | 4 ++-- gtk2_ardour/editor.h | 2 +- gtk2_ardour/editor_actions.cc | 3 ++- gtk2_ardour/editor_ops.cc | 12 +++++------- gtk2_ardour/editor_selection.cc | 2 +- gtk2_ardour/mnemonic-us.bindings.in | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index ab5dbc6bab..85383e2b02 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -154,7 +154,8 @@ - + + diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 3c8ce77a15..8a39a8fac1 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1836,7 +1836,7 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items) 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"), 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"), sigc::mem_fun(*this, &Editor::invert_selection))); 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_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"), sigc::mem_fun(*this, &Editor::invert_selection))); select_items.push_back (SeparatorElem()); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index b5533ec689..76006194b9 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -251,7 +251,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maybe_locate_with_edit_preroll (framepos_t); void play_with_preroll (); 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 (); void deselect_all (); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 411948248c..96b9bc05ae 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -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-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, "invert-selection", _("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection)); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index e4d6c267e9..9774efb853 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -133,7 +133,7 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) { bool frozen = false; - bool operating_on_region_selection = !selection->regions.empty(); + RegionSelection pre_selected_regions = selection->regions; list > used_playlists; list used_trackviews; @@ -234,12 +234,10 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) EditorThaw(); /* Emit Signal */ } - //IFF we had a selected region, 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( operating_on_region_selection ) { - if (!latest_regionviews.empty()) { - selection->add (latest_regionviews); - } + //IFF we were working on selected regions, then we should select both sides of the new region after the split. + if( !pre_selected_regions.empty() ) { + selection->add (latest_regionviews); //these are the new regions, created after the split + selection->add (pre_selected_regions); //these were the old selected regions, they got lost in the freeze/thaw } } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index fd9d68fe93..6f65b27345 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1370,7 +1370,7 @@ Editor::select_all_internal_edit (Selection::Operation) } void -Editor::select_all (Selection::Operation op) +Editor::select_all_regions (Selection::Operation op) { list touched; diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index 5d8ce13a90..3f30b20657 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -149,7 +149,7 @@ This mode provides many different operations on both regions and control points, @trans|Transport/Record|<@TERTIARY@>r|engage record @mmode|MouseMode/set-mouse-mode-timefx|t|timefx mode @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 @edit|Editor/alternate-redo|<@PRIMARY@>y|redo @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 @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-sync|<@TERTIARY@>a|align sync points @aep|Region/align-regions-start|<@PRIMARY@><@LEVEL4@>a|align start(s) -- cgit v1.2.3