diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-27 20:57:48 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-27 20:57:48 +0000 |
commit | f78913cc99ffd13001b4c4daf625391be77e79d0 (patch) | |
tree | 7576a54e9312d9c3bbfd490671c3b2b6702a5c51 /libs/ardour/audio_playlist.cc | |
parent | d1af0b89a847fbde9a30a95e0198380ff6f4e68d (diff) |
Crossfades: default xfades are now constant-power, -3dB rule, other options are constant power(-6dB) rule or use existing region fade shape as is; provide GUI control over options; fix some inconsistent behaviour regarding xfades when relayering
git-svn-id: svn://localhost/ardour2/branches/3.0@12113 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_playlist.cc')
-rw-r--r-- | libs/ardour/audio_playlist.cc | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index ebebc62c33..f1c89cc565 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -290,7 +290,6 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range) continue; } - boost::shared_ptr<AudioRegion> top; boost::shared_ptr<AudioRegion> bottom; @@ -317,8 +316,9 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range) */ if (done_start.find (top) == done_start.end() && done_end.find (bottom) == done_end.end ()) { - /* Top's fade-in will cause an implicit fade-out of bottom */ + /* Top's fade-in will cause an implicit fade-out of bottom */ + framecnt_t len = 0; switch (_session.config.get_xfade_model()) { case FullCrossfade: @@ -328,11 +328,22 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range) len = _session.config.get_short_xfade_seconds() * _session.frame_rate(); break; } - - top->set_fade_in_length (len); + + switch (_session.config.get_xfade_choice ()) { + case ConstantPowerMinus3dB: + top->set_fade_in (FadeConstantPowerMinus3dB, len); + break; + case ConstantPowerMinus6dB: + top->set_fade_in (FadeConstantPowerMinus6dB, len); + break; + case RegionFades: + top->set_fade_in_length (len); + break; + } top->set_fade_in_active (true); + top->set_fade_in_is_xfade (true); + done_start.insert (top); - done_end.insert (bottom); } } else if (c == Evoral::OverlapEnd) { @@ -349,17 +360,28 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range) framecnt_t len = 0; switch (_session.config.get_xfade_model()) { case FullCrossfade: - len = bottom->last_frame () - top->first_frame (); + len = top->last_frame () - bottom->first_frame (); break; case ShortCrossfade: len = _session.config.get_short_xfade_seconds() * _session.frame_rate(); break; } - - top->set_fade_out_length (len); + + switch (_session.config.get_xfade_choice ()) { + case ConstantPowerMinus3dB: + top->set_fade_out (FadeConstantPowerMinus3dB, len); + break; + case ConstantPowerMinus6dB: + top->set_fade_out (FadeConstantPowerMinus6dB, len); + break; + case RegionFades: + top->set_fade_out_length (len); + break; + } top->set_fade_out_active (true); + top->set_fade_out_is_xfade (true); + done_end.insert (top); - done_start.insert (bottom); } } } |