when adding a list of Stripables, sort them into PresentationInfo order first

This commit is contained in:
Paul Davis 2016-06-05 15:59:00 -04:00
parent 6a59100c3c
commit ea05a66736

View File

@ -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) {