mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 12:46:32 +01:00
when adding a list of Stripables, sort them into PresentationInfo order first
This commit is contained in:
parent
6a59100c3c
commit
ea05a66736
1 changed files with 17 additions and 0 deletions
|
|
@ -5219,6 +5219,21 @@ Editor::add_routes (RouteList& rlist)
|
||||||
add_stripables (sl);
|
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
|
void
|
||||||
Editor::add_stripables (StripableList& sl)
|
Editor::add_stripables (StripableList& sl)
|
||||||
{
|
{
|
||||||
|
|
@ -5228,6 +5243,8 @@ Editor::add_stripables (StripableList& sl)
|
||||||
TrackViewList new_selection;
|
TrackViewList new_selection;
|
||||||
bool from_scratch = (track_views.size() == 0);
|
bool from_scratch = (track_views.size() == 0);
|
||||||
|
|
||||||
|
sl.sort (PresentationInfoEditorSorter());
|
||||||
|
|
||||||
for (StripableList::iterator s = sl.begin(); s != sl.end(); ++s) {
|
for (StripableList::iterator s = sl.begin(); s != sl.end(); ++s) {
|
||||||
|
|
||||||
if ((v = boost::dynamic_pointer_cast<VCA> (*s)) != 0) {
|
if ((v = boost::dynamic_pointer_cast<VCA> (*s)) != 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue