Fix "Select All * Edit Point" when used as shortcut. -fixes #6626
authorAndré Nusser <andre.nusser@googlemail.com>
Wed, 7 Oct 2015 21:56:14 +0000 (23:56 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 8 Oct 2015 11:46:22 +0000 (13:46 +0200)
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_actions.cc
gtk2_ardour/editor_selection.cc

index b5d6a55dd839d98e262d0a07139e01f67b7143e9..9ed69351d5c2d19374853c1ef92e81f342f8003a 100644 (file)
@@ -1939,8 +1939,8 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
        select_items.push_back (MenuElem (_("Set Range to Punch Range"), sigc::mem_fun(*this, &Editor::set_selection_from_punch)));
        select_items.push_back (MenuElem (_("Set Range to Selected Regions"), sigc::mem_fun(*this, &Editor::set_selection_from_region)));
        select_items.push_back (SeparatorElem());
-       select_items.push_back (MenuElem (_("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true)));
-       select_items.push_back (MenuElem (_("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false)));
+       select_items.push_back (MenuElem (_("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true, true)));
+       select_items.push_back (MenuElem (_("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false, true)));
        select_items.push_back (MenuElem (_("Select All After Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, true)));
        select_items.push_back (MenuElem (_("Select All Before Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, false)));
        select_items.push_back (MenuElem (_("Select All Between Playhead and Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_between), false)));
@@ -2013,8 +2013,8 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items)
        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());
-       select_items.push_back (MenuElem (_("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true)));
-       select_items.push_back (MenuElem (_("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false)));
+       select_items.push_back (MenuElem (_("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true, true)));
+       select_items.push_back (MenuElem (_("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false, true)));
        select_items.push_back (MenuElem (_("Select All After Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, true)));
        select_items.push_back (MenuElem (_("Select All Before Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, false)));
 
index 013f82d8b2a65450d839b74e255bb4aba2f5e445..f558355bb05a86de42e29b63e0c2508dd4a0182f 100644 (file)
@@ -1035,7 +1035,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void    selected_marker_to_selection_end   ();
 
        void    select_all_selectables_using_cursor (EditorCursor *, bool);
-       void    select_all_selectables_using_edit (bool);
+       void    select_all_selectables_using_edit (bool, bool);
        void    select_all_selectables_between (bool within);
        void    select_range_between ();
 
index 388d4fd34d54fae9df9bf95b8eb1fbcced0d627b..c8e52d85455242223c34b794a9c4b43473bf2449 100644 (file)
@@ -201,10 +201,10 @@ Editor::register_actions ()
        reg_sens (editor_actions, "select-punch-range", _("Set Range to Punch Range"), sigc::mem_fun(*this, &Editor::set_selection_from_punch));
        reg_sens (editor_actions, "select-from-regions", _("Set Range to Selected Regions"), sigc::mem_fun(*this, &Editor::set_selection_from_region));
 
-       reg_sens (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
-       reg_sens (editor_actions, "alternate-select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
-       reg_sens (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
-       reg_sens (editor_actions, "alternate-select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
+       reg_sens (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true, false));
+       reg_sens (editor_actions, "alternate-select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true, false));
+       reg_sens (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false, false));
+       reg_sens (editor_actions, "alternate-select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false, false));
 
        reg_sens (editor_actions, "select-all-between-cursors", _("Select All Overlapping Edit Range"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_between), false));
        reg_sens (editor_actions, "select-all-within-cursors", _("Select All Inside Edit Range"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_between), true));
index 5a59b48a90fa3a72c1d0a99042b5e21069d408b8..85ec795e408c49773b1cd54eada33eda492e9d91 100644 (file)
@@ -1819,17 +1819,17 @@ Editor::select_all_selectables_using_cursor (EditorCursor *cursor, bool after)
 }
 
 void
-Editor::select_all_selectables_using_edit (bool after)
+Editor::select_all_selectables_using_edit (bool after, bool from_context_menu)
 {
        framepos_t start;
        framepos_t end;
        list<Selectable *> touched;
 
        if (after) {
-               start = get_preferred_edit_position(EDIT_IGNORE_NONE, true);
+               start = get_preferred_edit_position(EDIT_IGNORE_NONE, from_context_menu);
                end = _session->current_end_frame();
        } else {
-               if ((end = get_preferred_edit_position(EDIT_IGNORE_NONE, true)) > 1) {
+               if ((end = get_preferred_edit_position(EDIT_IGNORE_NONE, from_context_menu)) > 1) {
                        start = 0;
                        end -= 1;
                } else {