summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-01-04 01:03:36 +0000
committerCarl Hetherington <carl@carlh.net>2011-01-04 01:03:36 +0000
commitfde56cc730cc4d0fad1bccd19f9ebdae90ce0deb (patch)
tree195fc8e0a1557a60b9048edfba13d6a22efc4cd8 /gtk2_ardour
parentaea2a9f0d774e0ed0ffd08911a6df7af81aa29a6 (diff)
Unselect regions on tracks when the tracks are hidden. Fixes #3653.
git-svn-id: svn://localhost/ardour2/branches/3.0@8426 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/selection.cc16
-rw-r--r--gtk2_ardour/selection.h2
-rw-r--r--gtk2_ardour/time_axis_view.cc3
3 files changed, 20 insertions, 1 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index b135593a62..fa0df40336 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -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;
+ }
+}
diff --git a/gtk2_ardour/selection.h b/gtk2_ardour/selection.h
index 0a73ae275e..c9d3e9b759 100644
--- a/gtk2_ardour/selection.h
+++ b/gtk2_ardour/selection.h
@@ -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();
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index a206b1a231..6dc1382c3d 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -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 ();
}