From ee576b7ff70f88544a6fecd632c4aad0d7f926c3 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 13 Apr 2008 23:30:40 -0500 Subject: [PATCH] Use linear curve for declicking fades --- Timeline/Region.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Timeline/Region.C b/Timeline/Region.C index 72c145c..e762d3e 100644 --- a/Timeline/Region.C +++ b/Timeline/Region.C @@ -760,14 +760,16 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co /* perform declicking if necessary */ - const nframes_t declick_frames = 1024; + /* FIXME: shouldn't this be wallclock time? */ + const nframes_t declick_frames = 256; + const fade_type_e type = Linear; if ( start + cnt + declick_frames > r.end ) { /* declick end */ const nframes_t d = r.end - start; - apply_fade( buf, FADE_OUT, Cosine, cnt + (long)d - declick_frames, cnt + d, cnt ); + apply_fade( buf, FADE_OUT, type , cnt + (long)d - declick_frames, cnt + d, cnt ); } if ( sofs < declick_frames ) @@ -775,7 +777,7 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co /* declick start */ const long d = 0 - sofs; - apply_fade( buf + ofs, FADE_IN, Cosine, d, d + declick_frames, cnt - ofs ); + apply_fade( buf + ofs, FADE_IN, type, d, d + declick_frames, cnt - ofs ); } // printf( "read %lu frames\n", cnt );