From a9ae875b7168e761867941c1bd0158e1b9e96713 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 24 Aug 2018 14:17:14 -0400 Subject: a couple more explanatory comments, and rename a variable to be more clear --- libs/ardour/selection.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libs/ardour/selection.cc b/libs/ardour/selection.cc index 8cab4b1766..5bd186510a 100644 --- a/libs/ardour/selection.cc +++ b/libs/ardour/selection.cc @@ -120,6 +120,8 @@ CoreSelection::select_adjacent_stripable (bool mixer_order, bool routes_only, r = boost::dynamic_pointer_cast (*s); + /* monitor is never selectable anywhere. for now, anyway */ + if ((!routes_only || r) && !(*s)->is_monitor()) { if (select_stripable_and_maybe_group (*s, true, routes_only, 0)) { return; @@ -142,24 +144,32 @@ CoreSelection::select_prev_stripable (bool mixer_order, bool routes_only) bool -CoreSelection::select_stripable_and_maybe_group (boost::shared_ptr s, bool with_group, bool routes_only, RouteGroup* group) +CoreSelection::select_stripable_and_maybe_group (boost::shared_ptr s, bool with_group, bool routes_only, RouteGroup* not_allowed_in_group) { boost::shared_ptr r; StripableList sl; + /* no selection of hidden stripables (though they can be selected and + * then hidden + */ + if (s->is_hidden()) { return false; } if ((r = boost::dynamic_pointer_cast (s))) { + /* no selection of inactive routes, though they can be selected + * and made inactive. + */ + if (!r->active()) { return false; } if (with_group) { - if (!group || !r->route_group() || r->route_group() != group) { + if (!not_allowed_in_group || !r->route_group() || r->route_group() != not_allowed_in_group) { if (r->route_group() && r->route_group()->is_select()) { boost::shared_ptr rl = r->route_group()->route_list (); -- cgit v1.2.3