diff options
-rw-r--r-- | gtk2_ardour/editor.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 3ff3d6aa3b..972583d57d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5219,6 +5219,21 @@ Editor::add_routes (RouteList& rlist) add_stripables (sl); } +struct PresentationInfoEditorSorter +{ + bool operator() (boost::shared_ptr<Stripable> a, boost::shared_ptr<Stripable> b) { + if (a->is_master()) { + /* master before everything else */ + return true; + } else if (b->is_master()) { + /* everything else before master */ + return false; + } + return a->presentation_info().order () < b->presentation_info().order (); + } +}; + + void Editor::add_stripables (StripableList& sl) { @@ -5228,6 +5243,8 @@ Editor::add_stripables (StripableList& sl) TrackViewList new_selection; bool from_scratch = (track_views.size() == 0); + sl.sort (PresentationInfoEditorSorter()); + for (StripableList::iterator s = sl.begin(); s != sl.end(); ++s) { if ((v = boost::dynamic_pointer_cast<VCA> (*s)) != 0) { |