Add option to limit automatable control parmaters
[ardour.git] / libs / ardour / selection.cc
index 5bd186510afbff5876be496adedbbfd4816b76d3..b41b387e69ae2ab2489fcf50f2c9aee92a1c7e44 100644 (file)
@@ -30,6 +30,8 @@
 #include "ardour/session.h"
 #include "ardour/stripable.h"
 
+#include "pbd/i18n.h"
+
 using namespace ARDOUR;
 using namespace PBD;
 
@@ -51,7 +53,7 @@ CoreSelection::~CoreSelection ()
 {
 }
 
-template<typename IterTypeForward, typename IterTypeCore>
+template<typename IterTypeCore>
 void
 CoreSelection::select_adjacent_stripable (bool mixer_order, bool routes_only,
                                           IterTypeCore (StripableList::*begin_method)(),
@@ -65,7 +67,7 @@ CoreSelection::select_adjacent_stripable (bool mixer_order, bool routes_only,
                session.get_stripables (stripables);
                stripables.sort (ARDOUR::Stripable::Sorter (mixer_order));
 
-               for (IterTypeForward s = (stripables.*begin_method)(); s != (stripables.*end_method)(); ++s) {
+               for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
                        if (select_stripable_and_maybe_group (*s, true, routes_only, 0)) {
                                break;
                        }
@@ -122,7 +124,7 @@ CoreSelection::select_adjacent_stripable (bool mixer_order, bool routes_only,
 
                /* monitor is never selectable anywhere. for now, anyway */
 
-               if ((!routes_only || r) && !(*s)->is_monitor()) {
+               if (!routes_only || r) {
                        if (select_stripable_and_maybe_group (*s, true, routes_only, 0)) {
                                return;
                        }
@@ -157,6 +159,12 @@ CoreSelection::select_stripable_and_maybe_group (boost::shared_ptr<Stripable> s,
                return false;
        }
 
+       /* monitor is never selectable */
+
+       if (s->is_monitor()) {
+               return false;
+       }
+
        if ((r = boost::dynamic_pointer_cast<Route> (s))) {
 
                /* no selection of inactive routes, though they can be selected