Unselect regions on tracks when the tracks are hidden. Fixes #3653.
authorCarl Hetherington <carl@carlh.net>
Tue, 4 Jan 2011 01:03:36 +0000 (01:03 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 4 Jan 2011 01:03:36 +0000 (01:03 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8426 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/selection.cc
gtk2_ardour/selection.h
gtk2_ardour/time_axis_view.cc

index b135593a62623860f8cf5547f9d0ff96c95798f5..fa0df40336de07f16e800c6a041008bf8f371ed1 100644 (file)
@@ -1163,3 +1163,19 @@ Selection::set_state (XMLNode const & node, int)
 
        return 0;
 }
+
+void
+Selection::remove_regions (TimeAxisView* t)
+{
+       RegionSelection::iterator i = regions.begin();
+       while (i != regions.end ()) {
+               RegionSelection::iterator tmp = i;
+               ++tmp;
+
+               if (&(*i)->get_time_axis_view() == t) {
+                       remove (*i);
+               }
+
+               i = tmp;
+       }
+}
index 0a73ae275e7f8fb5403746a999196910c4068c75..c9d3e9b7590a774ee7c8b7d3dacb520e6283118e 100644 (file)
@@ -174,6 +174,8 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
        void remove (const std::list<Selectable*>&);
        void remove (Marker*);
 
+       void remove_regions (TimeAxisView *);
+
        void replace (uint32_t time_index, framepos_t start, framepos_t end);
 
        void clear_regions();
index a206b1a2313c5cbc60eb75bc4d30a8d83798051c..6dc1382c3d393072add7d44129dc84cecb4acab7 100644 (file)
@@ -372,8 +372,9 @@ TimeAxisView::hide ()
        }
 
        /* if its hidden, it cannot be selected */
-
        _editor.get_selection().remove (this);
+       /* and neither can its regions */
+       _editor.get_selection().remove_regions (this);
 
        Hiding ();
 }