summaryrefslogtreecommitdiff
path: root/libs/ardour/playlist.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-25 18:51:00 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-25 18:51:00 +0000
commit9925ab554e65ac31a41eff1fa03a9c12aad1973e (patch)
tree401f1aafeceb160b3adb98de3a6a97889278b11a /libs/ardour/playlist.cc
parent04b54f8dd1e1be93250b1fe0f133665d0ff493e4 (diff)
logic to copy audio region fade in/fade out into compound regions (one-way for now)
git-svn-id: svn://localhost/ardour2/branches/3.0@9588 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r--libs/ardour/playlist.cc42
1 files changed, 9 insertions, 33 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 4a5405841f..3ca4fddfb1 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -38,6 +38,7 @@
#include "ardour/session.h"
#include "ardour/region.h"
#include "ardour/region_factory.h"
+#include "ardour/region_sorters.h"
#include "ardour/playlist_factory.h"
#include "ardour/playlist_source.h"
#include "ardour/transient_detector.h"
@@ -65,40 +66,7 @@ struct ShowMeTheList {
string name;
};
-struct RegionSortByLayer {
- bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
- return a->layer() < b->layer();
- }
-};
-
-struct RegionSortByLayerWithPending {
- bool operator () (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
-
- double p = a->layer ();
- if (a->pending_explicit_relayer()) {
- p += 0.5;
- }
-
- double q = b->layer ();
- if (b->pending_explicit_relayer()) {
- q += 0.5;
- }
-
- return p < q;
- }
-};
-
-struct RegionSortByPosition {
- bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
- return a->position() < b->position();
- }
-};
-struct RegionSortByLastLayerOp {
- bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
- return a->last_layer_op() < b->last_layer_op();
- }
-};
void
Playlist::make_property_quarks ()
@@ -3160,6 +3128,7 @@ Playlist::combine (const RegionList& r)
uint32_t layer = 0;
framepos_t earliest_position = max_framepos;
vector<TwoRegions> old_and_new_regions;
+ vector<boost::shared_ptr<Region> > originals;
string parent_name;
string child_name;
uint32_t max_level = 0;
@@ -3193,6 +3162,7 @@ Playlist::combine (const RegionList& r)
boost::shared_ptr<Region> copied_region = RegionFactory::create (original_region, false);
old_and_new_regions.push_back (TwoRegions (original_region,copied_region));
+ originals.push_back (original_region);
RegionFactory::add_compound_association (original_region, copied_region);
@@ -3254,6 +3224,12 @@ Playlist::combine (const RegionList& r)
remove_region (*i);
}
+ /* do type-specific stuff with the originals and the new compound
+ region
+ */
+
+ pre_combine (originals, compound_region);
+
/* add the new region at the right location */
add_region (compound_region, earliest_position);