From 30c08ba655330232767554c48bda1975bfb5628c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 11 Aug 2006 03:24:57 +0000 Subject: - Changed IO's vector'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 --- libs/ardour/reverse.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'libs/ardour/reverse.cc') 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(*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; } -- cgit v1.2.3