Playlist UI tweaks: change sort order to use pgroup when one is available

This commit is contained in:
Ben Loftis
2021-05-31 20:54:14 -05:00
parent 932b07b7b0
commit 25786ac130

View File

@@ -43,7 +43,13 @@ class RouteUI;
struct PlaylistSorterByID {
bool operator() (boost::shared_ptr<ARDOUR::Playlist> a, boost::shared_ptr<ARDOUR::Playlist> b) const {
return a->sort_id() < b->sort_id();
if (a->pgroup_id().length() && b->pgroup_id().length()) {
return (a->id() < b->id()); /*both plists have pgroup-id: use IDs which are sequentially generated */
} else if (!a->pgroup_id().length() && !b->pgroup_id().length()) {
return (a->sort_id() < b->sort_id()); /*old session: neither plist has a pgroup-id: use prior sort_id calculation */ /*DEPRECATED*/
} else {
return (a->pgroup_id().length() < b->pgroup_id().length()); /*mix of old & new: old ones go on top */
}
}
};