Prevent direct and indirect selection of VCAs
authorRobin Gareus <robin@gareus.org>
Fri, 17 Feb 2017 23:45:37 +0000 (00:45 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 17 Feb 2017 23:45:37 +0000 (00:45 +0100)
the ::selection_filter() does not cover select-all and various other
indirect selection operations.

gtk2_ardour/selection.cc
gtk2_ardour/track_selection.cc

index ce39138586e76edef6298bd4de6cc67d3103fc5d..298889e329ab2daf9c8d9a0d638cbf88bc5e4580 100644 (file)
@@ -40,6 +40,7 @@
 #include "automation_time_axis.h"
 #include "public_editor.h"
 #include "control_point.h"
+#include "vca_time_axis.h"
 
 #include "pbd/i18n.h"
 
@@ -274,6 +275,9 @@ Selection::toggle (const TrackViewList& track_list)
        PresentationInfo::ChangeSuspender cs;
 
        for (TrackViewList::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
+               if (dynamic_cast<VCATimeAxisView*> (*i)) {
+                       continue;
+               }
                toggle ((*i));
        }
 }
@@ -281,6 +285,10 @@ Selection::toggle (const TrackViewList& track_list)
 void
 Selection::toggle (TimeAxisView* track)
 {
+       if (dynamic_cast<VCATimeAxisView*> (track)) {
+               return;
+       }
+
        TrackSelection::iterator i;
 
        if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
@@ -437,6 +445,9 @@ Selection::add (TrackViewList const & track_list)
 
        if (!added.empty()) {
                for (TrackViewList::iterator x = added.begin(); x != added.end(); ++x) {
+                       if (dynamic_cast<VCATimeAxisView*> (*x)) {
+                               continue;
+                       }
                        (*x)->set_selected (true);
                }
        }
@@ -445,6 +456,9 @@ Selection::add (TrackViewList const & track_list)
 void
 Selection::add (TimeAxisView* track)
 {
+       if (dynamic_cast<VCATimeAxisView*> (track)) {
+               return;
+       }
        clear_objects();  //enforce object/range exclusivity
 
        TrackViewList tr;
@@ -783,6 +797,9 @@ Selection::remove (boost::shared_ptr<ARDOUR::AutomationList> ac)
 void
 Selection::set (TimeAxisView* track)
 {
+       if (dynamic_cast<VCATimeAxisView*> (track)) {
+               return;
+       }
        clear_objects ();  //enforce object/range exclusivity
 
        PresentationInfo::ChangeSuspender cs;
@@ -822,6 +839,9 @@ Selection::set (const TrackViewList& track_list)
                        bool missing = false;
 
                        for (TrackViewList::const_iterator x = track_list.begin(); x != track_list.end(); ++x) {
+                               if (dynamic_cast<VCATimeAxisView*> (*x)) {
+                                       continue;
+                               }
                                if (find (tracks.begin(), tracks.end(), *x) == tracks.end()) {
                                        missing = true;
                                }
@@ -836,6 +856,9 @@ Selection::set (const TrackViewList& track_list)
                /* argument is different from existing selection */
 
                for (TrackViewList::iterator x = tracks.begin(); x != tracks.end(); ++x) {
+                       if (dynamic_cast<VCATimeAxisView*> (*x)) {
+                               continue;
+                       }
                        (*x)->set_selected (false);
                }
 
index 8b065faef31b66f44ff5d15f5c62e69740166c1a..ac3d8b68e52b891e8833b86e9267a69915be891c 100644 (file)
@@ -25,6 +25,7 @@
 #include "track_selection.h"
 #include "time_axis_view.h"
 #include "public_editor.h"
+#include "vca_time_axis.h"
 
 using namespace std;
 
@@ -44,6 +45,9 @@ TrackSelection::add (TrackViewList const & t)
        TrackViewList added;
 
        for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
+               if (dynamic_cast<VCATimeAxisView*> (*i)) {
+                       continue;
+               }
 
                /* select anything in the same select-enabled route group */
                ARDOUR::RouteGroup* rg = (*i)->route_group ();