summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_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/audio_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/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)
+{
+}