summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-05 15:59:00 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-05 16:33:01 -0400
commitea05a667366a96f0cfe3e0241c41875f7b7b7a91 (patch)
tree4d95d9e0dd6aac59ae14c310d2d597ee87e09514 /gtk2_ardour
parent6a59100c3c3474e10680d5aaa31f5bbdc9d0de47 (diff)
when adding a list of Stripables, sort them into PresentationInfo order first
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.cc17
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) {