diff options
author | Jesse Chappell <jesse@essej.net> | 2006-02-10 23:53:12 +0000 |
---|---|---|
committer | Jesse Chappell <jesse@essej.net> | 2006-02-10 23:53:12 +0000 |
commit | 9ab70fb55284537228577d575f15aa03949bd678 (patch) | |
tree | 47a44c65846a46bb6bff1b49caa8edb68c2b8c13 /libs/ardour/import.cc | |
parent | 17cb448b1df0def4c1e09da615e11a64f6e692e3 (diff) |
committed INCOMPLETE 24bit filesource support
git-svn-id: svn://localhost/trunk/ardour2@316 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/import.cc')
-rw-r--r-- | libs/ardour/import.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 3411481a3a..f5884a1c1d 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -42,7 +42,7 @@ using namespace ARDOUR; -#define BLOCKSIZE 2048U +#define BLOCKSIZE 4096U int Session::import_audiofile (import_status& status) @@ -53,6 +53,7 @@ Session::import_audiofile (import_status& status) SF_INFO info; float *data = 0; Sample **channel_data = 0; + char * workbuf = 0; long nfiles = 0; long n; string basepath; @@ -147,7 +148,8 @@ Session::import_audiofile (import_status& status) data = new float[BLOCKSIZE * info.channels]; channel_data = new Sample * [ info.channels ]; - + workbuf = new char[BLOCKSIZE * 4]; + for (n = 0; n < info.channels; ++n) { channel_data[n] = new Sample[BLOCKSIZE]; } @@ -178,7 +180,7 @@ Session::import_audiofile (import_status& status) /* flush to disk */ for (chn = 0; chn < info.channels; ++chn) { - newfiles[chn]->write (channel_data[chn], nread); + newfiles[chn]->write (channel_data[chn], nread, workbuf); } so_far += nread; @@ -245,7 +247,10 @@ Session::import_audiofile (import_status& status) if (data) { delete [] data; } - + if (workbuf) { + delete [] workbuf; + } + if (channel_data) { for (n = 0; n < info.channels; ++n) { delete [] channel_data[n]; |