X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fplaylist.cc;h=8862c633ab62fbe6578b5d5b3ed36605a174101a;hb=46c83693284ece4a732d26e62113ea4ac584d539;hp=d121ee04ff0c0d0bd8deb5bd5debe948c5ea2639;hpb=ced4378d0914bcfb926267772c45d1d23f3bed38;p=ardour.git diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index d121ee04ff..8862c633ab 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -1642,6 +1642,8 @@ Playlist::region_bounds_changed (const PropertyChange& what_changed, boost::shar save = true; } + mark_session_dirty (); + return save; } @@ -2333,7 +2335,10 @@ struct RelayerSort { void Playlist::set_layer (boost::shared_ptr region, double new_layer) { - /* Remove the layer we are setting from our region list, and sort it */ + /* Remove the layer we are setting from our region list, and sort it + * using the layer indeces. + */ + RegionList copy = regions.rlist(); copy.remove (region); copy.sort (RelayerSort ()); @@ -2362,6 +2367,12 @@ Playlist::setup_layering_indices (RegionList const & regions) } } +struct LaterHigherSort { + bool operator () (boost::shared_ptr a, boost::shared_ptr b) { + return a->position() < b->position(); + } +}; + /** Take the layering indices of each of our regions, compute the layers * that they should be on, and write the layers back to the regions. */ @@ -2396,9 +2407,16 @@ Playlist::relayer () vector > layers; layers.push_back (vector (divisions)); - /* Sort our regions into layering index order */ + /* Sort our regions into layering index order (for manual layering) or position order (for later is higher)*/ RegionList copy = regions.rlist(); - copy.sort (RelayerSort ()); + switch (Config->get_layer_model()) { + case LaterHigher: + copy.sort (LaterHigherSort ()); + break; + case Manual: + copy.sort (RelayerSort ()); + break; + } DEBUG_TRACE (DEBUG::Layering, "relayer() using:\n"); for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {