Browse Source

Fix math error in fade application.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
6d2521312e
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      Timeline/Region.C

+ 6
- 2
Timeline/Region.C View File

@@ -900,7 +900,7 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co


/* apply gain */ /* apply gain */


buffer_apply_gain( buf, cnt, _scale );
buffer_apply_gain( buf + ofs, cnt, _scale );


/* perform declicking if necessary */ /* perform declicking if necessary */


@@ -920,7 +920,9 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co
{ {
const long d = 0 - sofs; const long d = 0 - sofs;


fade.apply( buf + ofs, Fade::In, d, d + fade.length, cnt - ofs );
assert( cnt <= nframes );

fade.apply( buf + ofs, Fade::In, d, d + fade.length, cnt );
} }


fade = declick < _fade_out ? _fade_out : declick; fade = declick < _fade_out ? _fade_out : declick;
@@ -931,6 +933,8 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co
{ {
const nframes_t d = r.end - start; const nframes_t d = r.end - start;


assert( cnt <= nframes );

fade.apply( buf, Fade::Out, cnt + (long)d - fade.length, cnt + d, cnt ); fade.apply( buf, Fade::Out, cnt + (long)d - fade.length, cnt + d, cnt );
} }
} }


Loading…
Cancel
Save