a couple more explanatory comments, and rename a variable to be more clear
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 24 Aug 2018 18:17:14 +0000 (14:17 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 24 Aug 2018 18:17:14 +0000 (14:17 -0400)
libs/ardour/selection.cc

index 8cab4b1766fa54ef61fc84e1e670e4998306c170..5bd186510afbff5876be496adedbbfd4816b76d3 100644 (file)
@@ -120,6 +120,8 @@ CoreSelection::select_adjacent_stripable (bool mixer_order, bool routes_only,
 
                r = boost::dynamic_pointer_cast<Route> (*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<Stripable> s, bool with_group, bool routes_only, RouteGroup* group)
+CoreSelection::select_stripable_and_maybe_group (boost::shared_ptr<Stripable> s, bool with_group, bool routes_only, RouteGroup* not_allowed_in_group)
 {
        boost::shared_ptr<Route> 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<Route> (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<RouteList> rl = r->route_group()->route_list ();