summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-02-04 15:08:04 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-02-04 15:08:22 +0100
commit8e06f43f8066c90c51552fa71fffaaa81d9f1944 (patch)
treeddb029c0a61d56d00b9cb28e0a7737cf6f7b800c /gtk2_ardour
parent893d4e7a072c3babf4671d441dd756987854351f (diff)
make more of an effort to ensure that the last element in Selection::tracks is the most-recently selected
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/track_selection.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/gtk2_ardour/track_selection.cc b/gtk2_ardour/track_selection.cc
index 6937eb623d..8b065faef3 100644
--- a/gtk2_ardour/track_selection.cc
+++ b/gtk2_ardour/track_selection.cc
@@ -41,22 +41,41 @@ TrackSelection::~TrackSelection ()
TrackViewList
TrackSelection::add (TrackViewList const & t)
{
- TrackViewList added = TrackViewList::add (t);
+ TrackViewList added;
for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
/* select anything in the same select-enabled route group */
ARDOUR::RouteGroup* rg = (*i)->route_group ();
+
if (rg && rg->is_active() && rg->is_select ()) {
+
TrackViewList tr = _editor->axis_views_from_routes (rg->route_list ());
+
for (TrackViewList::iterator j = tr.begin(); j != tr.end(); ++j) {
- if (!contains (*j)) {
- added.push_back (*j);
- push_back (*j);
+
+ /* Do not add the trackview passed in as an
+ * argument, because we want that to be on the
+ * end of the list.
+ */
+
+ if (*j != *i) {
+ if (!contains (*j)) {
+ added.push_back (*j);
+ push_back (*j);
+ }
}
}
}
+
+ /* now add the the trackview's passed in as actual arguments */
+
+ if (!contains (*i)) {
+ added.push_back (*i);
+ push_back (*i);
+ }
}
+
return added;
}