summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_playlist.cc
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2007-10-26 13:32:24 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2007-10-26 13:32:24 +0000
commitcc862d31bd8c9005964dca94a9942f1b42847252 (patch)
tree66b2ee6c0201b2b9f6929aa6f5190b5a4c05e22d /libs/ardour/audio_playlist.cc
parent0c3f01e54074a9b47dcab9b3ec0ed8a9729dbc87 (diff)
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_playlist.cc')
-rw-r--r--libs/ardour/audio_playlist.cc67
1 files changed, 61 insertions, 6 deletions
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index f4c10cbc12..0631c9121b 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -337,6 +337,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
boost::shared_ptr<AudioRegion> top;
boost::shared_ptr<AudioRegion> bottom;
boost::shared_ptr<Crossfade> xfade;
+ RegionList* touched_regions;
if (in_set_state || in_partition) {
return;
@@ -398,7 +399,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
break;
case OverlapExternal:
-
+
/* [ -------- top ------- ]
* {=========== bottom =============}
*/
@@ -411,11 +412,15 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
*/
xfade_length = min ((nframes_t) 720, top->length());
-
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
- add_crossfade (xfade);
+
+ if (top_region_at (top->first_frame()) == top) {
+
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
+ add_crossfade (xfade);
+ }
if (top_region_at (top->last_frame() - 1) == top) {
+
/*
only add a fade out if there is no region on top of the end of 'top' (which
would cover it).
@@ -425,9 +430,58 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
add_crossfade (xfade);
}
break;
-
+ case OverlapStart:
+
+ /* { ==== top ============ }
+ * [---- bottom -------------------]
+ */
+
+ if (Config->get_xfade_model() == FullCrossfade) {
+ touched_regions = regions_touched (top->first_frame(), bottom->last_frame());
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+ } else {
+
+ touched_regions = regions_touched (top->first_frame(),
+ top->first_frame() + min ((nframes_t)Config->get_short_xfade_seconds() * _session.frame_rate(),
+ top->length()));
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+ }
+ break;
+ case OverlapEnd:
+
+
+ /* [---- top ------------------------]
+ * { ==== bottom ============ }
+ */
+
+ if (Config->get_xfade_model() == FullCrossfade) {
+
+ touched_regions = regions_touched (bottom->first_frame(), top->last_frame());
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
+ Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+
+ } else {
+ touched_regions = regions_touched (bottom->first_frame(),
+ bottom->first_frame() + min ((nframes_t)Config->get_short_xfade_seconds() * _session.frame_rate(),
+ bottom->length()));
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+ }
+ break;
default:
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
+ Config->get_xfade_model(), Config->get_xfades_active()));
add_crossfade (xfade);
}
}
@@ -471,6 +525,7 @@ void AudioPlaylist::notify_crossfade_added (boost::shared_ptr<Crossfade> x)
if (g_atomic_int_get(&block_notifications)) {
_pending_xfade_adds.insert (_pending_xfade_adds.end(), x);
} else {
+
NewCrossfade (x); /* EMIT SIGNAL */
}
}