diff options
author | David Robillard <d@drobilla.net> | 2006-08-11 03:24:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-11 03:24:57 +0000 |
commit | 30c08ba655330232767554c48bda1975bfb5628c (patch) | |
tree | c6bf6b62de69afdd6b2a42ef3a7d9f80e0f65f7c /libs/ardour/reverse.cc | |
parent | ab6f1ed9bafa869648b6e94ee5186ff317b32c3e (diff) |
- Changed IO's vector<Port*>'s to PortList
- Added new Port classes, code to drive them
- Added PortList, which is a filthy mess ATM (nevermind that, it's the interface that's important at this stage)
- Added ChanCount, though it isn't very thoroughly used yet. That's the next step....
- Fixed a few bugs relating to loading sessions saved with trunk
- Fixed a few random other bugs
Slowly working towards type agnosticism while keeping all the former code/logic intact is the name of the game here
Warning: Removing ports is currently (intentionally) broken due solely to laziness.
git-svn-id: svn://localhost/ardour2/branches/midi@786 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/reverse.cc')
-rw-r--r-- | libs/ardour/reverse.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libs/ardour/reverse.cc b/libs/ardour/reverse.cc index 13dd531bac..b981ff0722 100644 --- a/libs/ardour/reverse.cc +++ b/libs/ardour/reverse.cc @@ -49,7 +49,6 @@ Reverse::run (AudioRegion& region) AudioRegion::SourceList::iterator si; const jack_nframes_t blocksize = 256 * 1048; Sample buf[blocksize]; - char * workbuf = 0;; jack_nframes_t fpos; jack_nframes_t fend; jack_nframes_t fstart; @@ -62,8 +61,6 @@ Reverse::run (AudioRegion& region) goto out; } - workbuf = new char[blocksize * 4]; - fend = region.start() + region.length(); fstart = region.start(); @@ -82,10 +79,11 @@ Reverse::run (AudioRegion& region) uint32_t n; for (n = 0, si = nsrcs.begin(); n < region.n_channels(); ++n, ++si) { + AudioSource* const asrc = dynamic_cast<AudioSource*>(*si); /* read it in */ - if (region.source (n).read (buf, fpos, to_read, workbuf) != to_read) { + if (region.audio_source (n).read (buf, fpos, to_read) != to_read) { goto out; } @@ -97,7 +95,7 @@ Reverse::run (AudioRegion& region) /* write it out */ - if ((*si)->write (buf, to_read, workbuf) != to_read) { + if (asrc->write (buf, to_read) != to_read) { goto out; } } @@ -123,9 +121,6 @@ Reverse::run (AudioRegion& region) delete *si; } } - if (workbuf) { - delete [] workbuf; - } return ret; } |