summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_playlist.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/audio_playlist.cc')
-rw-r--r--libs/ardour/audio_playlist.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index ebff10f49e..f73bbf17e5 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -27,6 +27,7 @@
#include "ardour/audioplaylist.h"
#include "ardour/audioregion.h"
#include "ardour/crossfade.h"
+#include "ardour/region_sorters.h"
#include "ardour/session.h"
#include "pbd/enumwriter.h"
@@ -1080,3 +1081,45 @@ AudioPlaylist::copy_dependents (const vector<TwoRegions>& old_and_new, boost::sh
other_audio->add_crossfade (new_xfade);
}
}
+
+void
+AudioPlaylist::pre_combine (vector<boost::shared_ptr<Region> >& originals, boost::shared_ptr<Region> compound_region)
+{
+ /* sort the originals into time order */
+
+ RegionSortByPosition cmp;
+ boost::shared_ptr<AudioRegion> ar;
+ boost::shared_ptr<AudioRegion> cr;
+
+ if ((cr = boost::dynamic_pointer_cast<AudioRegion> (compound_region)) == 0) {
+ return;
+ }
+
+ sort (originals.begin(), originals.end(), cmp);
+
+ ar = boost::dynamic_pointer_cast<AudioRegion> (originals.front());
+
+ /* copy the fade in of the first into the compound region */
+
+ if (ar) {
+ cr->set_fade_in (ar->fade_in());
+
+ /* disable the fade in of the first */
+
+ ar->set_fade_in_active (false);
+ }
+
+ ar = boost::dynamic_pointer_cast<AudioRegion> (originals.front());
+
+ if (ar) {
+ /* copy the fade out of the last into the compound region */
+ cr->set_fade_out (ar->fade_out());
+ /* disable the fade out of the first */
+ ar->set_fade_out_active (false);
+ }
+}
+
+void
+AudioPlaylist::pre_uncombine (vector<boost::shared_ptr<Region> >& originals, boost::shared_ptr<Region> compound_region)
+{
+}