From 1ea4b09d5d11212853ab8139200f26bfa19498b7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 18 Apr 2012 22:23:12 +0000 Subject: [PATCH] Add drawing. git-svn-id: svn://localhost/ardour2/branches/3.0@12023 d708f5d6-7413-0410-9779-e7cbd77b26cf --- doc/region_read.svg | 623 ++++++++++++++++++++++++++++++++++ libs/ardour/audio_playlist.cc | 30 +- 2 files changed, 647 insertions(+), 6 deletions(-) create mode 100644 doc/region_read.svg diff --git a/doc/region_read.svg b/doc/region_read.svg new file mode 100644 index 0000000000..3f89819cdd --- /dev/null +++ b/doc/region_read.svg @@ -0,0 +1,623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + _position + (session frames) + + + + + fade_in_length + position + + + + cnt + to_read + and + + fade_interval_start + + + + + fade_interval_end + + fade_in_limit + + + + fade_out_offset + fade_out_limit + + + + internal_offset + + Region + + Range being read + + Fade + + diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index 47b2a5809a..06f9b3bc65 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -313,12 +313,21 @@ AudioPlaylist::check_crossfades (Evoral::Range range) */ if (done_start.find (top) == done_start.end() && done_end.find (bottom) == done_end.end ()) { - framecnt_t const len = bottom->last_frame () - top->first_frame (); + /* Top's fade-in will cause an implicit fade-out of bottom */ + + framecnt_t len = 0; + switch (_session.config.get_xfade_model()) { + case FullCrossfade: + len = bottom->last_frame () - top->first_frame (); + break; + case ShortCrossfade: + len = _session.config.get_short_xfade_seconds() * _session.frame_rate(); + break; + } + top->set_fade_in_length (len); top->set_fade_in_active (true); done_start.insert (top); - bottom->set_fade_out_length (len); - bottom->set_fade_out_active (true); done_end.insert (bottom); } @@ -331,12 +340,21 @@ AudioPlaylist::check_crossfades (Evoral::Range range) */ if (done_end.find (top) == done_end.end() && done_start.find (bottom) == done_start.end ()) { - framecnt_t const len = top->last_frame () - bottom->first_frame (); + /* Top's fade-out will cause an implicit fade-in of bottom */ + + framecnt_t len = 0; + switch (_session.config.get_xfade_model()) { + case FullCrossfade: + len = bottom->last_frame () - top->first_frame (); + break; + case ShortCrossfade: + len = _session.config.get_short_xfade_seconds() * _session.frame_rate(); + break; + } + top->set_fade_out_length (len); top->set_fade_out_active (true); done_end.insert (top); - bottom->set_fade_in_length (len); - bottom->set_fade_in_active (true); done_start.insert (bottom); } }