diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-11-11 14:12:08 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-11-11 14:12:08 +0000 |
commit | a4d46fb4ef88a548a6470417c7dfd88db2cab119 (patch) | |
tree | 335fd6a391691f4bbc3ec1dea28ce0785669816e /libs/ardour/reverse.cc | |
parent | 7324e4cbe781a63fd886bf32e50db60c9546b4b9 (diff) |
new region constructor for use by audiofilters (almost does a pure copy of the region, but sets start & sync_position appropriately, and uses new sources); fix up reverse bugs introduced in the last 36hrs; fix up setting of sync_position after split and so forth
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4140 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/reverse.cc')
-rw-r--r-- | libs/ardour/reverse.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/ardour/reverse.cc b/libs/ardour/reverse.cc index 2e78f25c22..a6ea7c4b10 100644 --- a/libs/ardour/reverse.cc +++ b/libs/ardour/reverse.cc @@ -66,6 +66,7 @@ Reverse::run (boost::shared_ptr<AudioRegion> region) } fpos = max (fstart, (fstart + region->length() - blocksize)); + buf = new Sample[blocksize]; to_read = blocksize; @@ -77,9 +78,9 @@ Reverse::run (boost::shared_ptr<AudioRegion> region) for (n = 0, si = nsrcs.begin(); n < region->n_channels(); ++n, ++si) { - /* read it in, with any amplitude scaling */ + /* read it in directly from the source */ - if (region->read (buf, fpos, to_read, n) != to_read) { + if (region->source (n)->read (buf, fpos, to_read, n) != to_read) { goto out; } @@ -88,7 +89,7 @@ Reverse::run (boost::shared_ptr<AudioRegion> region) for (nframes_t i = 0; i < to_read/2; ++i) { swap (buf[i],buf[to_read-1-i]); } - + /* write it out */ if ((*si)->write (buf, to_read) != to_read) { |