summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-05-05 16:34:32 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-05-05 18:56:25 +0100
commit589f6f67a3aaebffb4bf1a4d3bb170e2e7986e84 (patch)
treee88f99c71987b9bd3c79082423aeaacbd4908a44
parentdc0139d4af4d246f6dcafb04425e3f1198c347c3 (diff)
maintain CoreSelection order in GUI track selection
-rw-r--r--gtk2_ardour/selection.cc40
1 files changed, 12 insertions, 28 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index 23d89d0786..54dc7a6644 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -1640,37 +1640,21 @@ Selection::core_selection_changed (PropertyChange const & what_changed)
tracks.clear (); // clear stage for whatever tracks are now selected (maybe none)
- TrackViewList const & tvl (editor->get_track_views ());
-
- for (TrackViewList::const_iterator x = tvl.begin(); x != tvl.end(); ++x) {
-
- boost::shared_ptr<Stripable> s = (*x)->stripable ();
- boost::shared_ptr<AutomationControl> c = (*x)->control ();
-
- if (!s) {
- continue;
- }
-
- TimeAxisView* tav = editor->time_axis_view_from_stripable (s);
-
- if (!tav) {
- continue;
+ CoreSelection::StripableAutomationControls sac;
+ selection.get_stripables (sac);
+
+ for (CoreSelection::StripableAutomationControls::const_iterator i = sac.begin(); i != sac.end(); ++i) {
+ AxisView* av;
+ TimeAxisView* tav;
+ if ((*i).controllable) {
+ av = editor->axis_view_by_control ((*i).controllable);
+ } else {
+ av = editor->axis_view_by_stripable ((*i).stripable);
}
- if ((c && selection.selected (c)) || selection.selected (s)) {
+ tav = dynamic_cast<TimeAxisView*>(av);
+ if (tav) {
tracks.push_back (tav);
}
-
- TimeAxisView::Children kids = tav->get_child_list ();
-
- for (TimeAxisView::Children::iterator j = kids.begin(); j != kids.end(); ++j) {
- s = (*j)->stripable ();
- c = (*j)->control ();
-
- if ((c && selection.selected (c)) || selection.selected (s)) {
- tracks.push_back ((*j).get());
- }
- }
-
}
}