diff --git a/gtk2_ardour/ardour.keys.in b/gtk2_ardour/ardour.keys.in index 2d922696c5..8700f108b6 100644 --- a/gtk2_ardour/ardour.keys.in +++ b/gtk2_ardour/ardour.keys.in @@ -162,7 +162,7 @@ This mode provides many different operations on both regions and control points, @edit|Editor/redo|<@PRIMARY@>r|redo @trans|Transport/Record|<@TERTIARY@>r|engage record @mmode|MouseMode/set-mouse-mode-timefx|t|timefx mode -@gselect|Common/select-all-tracks|<@PRIMARY@>t|select all tracks +@gselect|Common/select-all-visible-lanes|<@PRIMARY@>t|select all visible lanes @edit|Editor/alternate-redo|<@PRIMARY@>y|redo @select|Editor/select-all-between-cursors|<@PRIMARY@>u|all enclosed by edit range @select|Editor/select-all-within-cursors|u|all present in edit range diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index cfc62ec25e..00990aab58 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -185,6 +185,7 @@ + diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index e6a6dc09c7..60b423bc02 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -645,6 +645,8 @@ ARDOUR_UI::install_dependent_actions () act = ActionManager::register_action (common_actions, "alt-finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(editor, &PublicEditor::keyboard_selection_finish), false, Editing::EDIT_IGNORE_NONE)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (common_actions, "select-all-visible-lanes", _("Select All Visible Lanes"), sigc::mem_fun(editor, &PublicEditor::select_all_visible_lanes)); + ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (common_actions, "select-all-tracks", _("Select All Tracks"), sigc::mem_fun(editor, &PublicEditor::select_all_tracks)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (common_actions, "deselect-all", _("Deselect All"), sigc::mem_fun(editor, &PublicEditor::deselect_all)); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 39973eb9a3..de202c8c4f 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -772,6 +772,7 @@ private: void catch_vanishing_regionview (RegionView*); void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false); + void select_all_visible_lanes (); void select_all_tracks (); bool select_all_internal_edit (Selection::Operation); diff --git a/gtk2_ardour/editor_keys.cc b/gtk2_ardour/editor_keys.cc index c4d9a173ea..9e86c615cc 100644 --- a/gtk2_ardour/editor_keys.cc +++ b/gtk2_ardour/editor_keys.cc @@ -58,7 +58,7 @@ Editor::keyboard_selection_finish (bool /*add*/, Editing::EditIgnoreOption ign) //if no tracks are selected and we're working from the keyboard, enable all tracks (_something_ has to be selected for any range selection) if ( (_edit_point == EditAtPlayhead) && selection->tracks.empty() ) - select_all_tracks(); + select_all_visible_lanes(); selection->set (start.sample, end); @@ -95,7 +95,7 @@ Editor::keyboard_selection_begin (Editing::EditIgnoreOption ign) //if no tracks are selected and we're working from the keyboard, enable all tracks (_something_ has to be selected for any range selection) if ( selection->tracks.empty() ) - select_all_tracks(); + select_all_visible_lanes(); selection->set (start.sample, end.sample); diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index fbdb485a3f..fa67ea4ab1 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -176,6 +176,20 @@ Editor::extend_selection_to_track (TimeAxisView& view) void Editor::select_all_tracks () +{ + TrackViewList tracks; + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { + RouteTimeAxisView* rtv = dynamic_cast(*i); + if ( rtv && rtv->route()->is_track() ) { + tracks.push_back (*i); + } + } + PBD::Unwinder uw (_track_selection_change_without_scroll, true); + selection->set (tracks); +} + +void +Editor::select_all_visible_lanes () { TrackViewList visible_views; for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { @@ -1893,7 +1907,7 @@ Editor::set_selection_from_range (Location& loc) // if no tracks are selected, enable all tracks // (_something_ has to be selected for any range selection, otherwise the user won't see anything) if (selection->tracks.empty()) { - select_all_tracks(); + select_all_visible_lanes(); } commit_reversible_selection_op (); diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc index c08f28df8a..775b94b5ca 100644 --- a/gtk2_ardour/luainstance.cc +++ b/gtk2_ardour/luainstance.cc @@ -945,6 +945,7 @@ LuaInstance::register_classes (lua_State* L) .addFunction ("copy_playlists", &PublicEditor::copy_playlists) .addFunction ("clear_playlists", &PublicEditor::clear_playlists) + .addFunction ("select_all_visible_lanes", &PublicEditor::select_all_visible_lanes) .addFunction ("select_all_tracks", &PublicEditor::select_all_tracks) .addFunction ("deselect_all", &PublicEditor::deselect_all) diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index bb546246b7..ba0b02cd88 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -291,6 +291,7 @@ public: virtual void new_playlists (TimeAxisView*) = 0; virtual void copy_playlists (TimeAxisView*) = 0; virtual void clear_playlists (TimeAxisView*) = 0; + virtual void select_all_visible_lanes () = 0; virtual void select_all_tracks () = 0; virtual void deselect_all () = 0; virtual void invert_selection () = 0; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 357ee29a91..274553f6b4 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1256,7 +1256,7 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev) if (_editor.get_selection().selected (this)) { _editor.get_selection().clear_tracks (); } else { - _editor.select_all_tracks (); + _editor.select_all_visible_lanes (); } _editor.commit_reversible_selection_op ();