Update of /cvsroot/audacity/audacity-src/src/blockfile In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8261/blockfile
Modified Files: ODDecodeBlockFile.cpp ODDecodeBlockFile.h SimpleBlockFile.cpp SimpleBlockFile.h Log Message: Addition of OD flac support struture. This feature is off by default and a #define (EXPERIMENTAL_OD_FLAC) is used to contain it. It does not work yet, but I wanted to check in now because the code has been accumulating and the changes I have made are inert. FLACs will still import as they always have. Index: ODDecodeBlockFile.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/blockfile/ODDecodeBlockFile.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ODDecodeBlockFile.cpp 14 Aug 2008 15:50:06 -0000 1.2 +++ ODDecodeBlockFile.cpp 8 Oct 2009 14:32:09 -0000 1.3 @@ -38,20 +38,25 @@ /// Create a disk file and write summary and sample data to it -ODDecodeBlockFile::ODDecodeBlockFile(wxFileName baseFileName,wxFileName audioFileName, - samplePtr sampleData, sampleCount sampleLen, - sampleFormat format, - bool allowDeferredWrite): - SimpleBlockFile(baseFileName,sampleData,sampleLen,format,allowDeferredWrite) +ODDecodeBlockFile::ODDecodeBlockFile(wxFileName baseFileName,wxFileName audioFileName, sampleCount aliasStart, + sampleCount aliasLen, int aliasChannel): + SimpleBlockFile(baseFileName,NULL,aliasLen,floatSample,true,true), //floatSample has no effect. last two bools - bypass writing of blockfile and cache + + mAliasStart(aliasStart), + mAliasChannel(aliasChannel) { mDataAvailable=false; mAudioFileName = audioFileName; } /// Create the memory structure to refer to the given block file -ODDecodeBlockFile::ODDecodeBlockFile(wxFileName existingFile, wxFileName audioFileName, sampleCount len, +ODDecodeBlockFile::ODDecodeBlockFile(wxFileName existingFile, wxFileName audioFileName, sampleCount aliasStart, + sampleCount aliasLen, int aliasChannel, float min, float max, float rms): - SimpleBlockFile(existingFile,len,min,max,rms) + SimpleBlockFile(existingFile,aliasLen,min,max,rms), + + mAliasStart(aliasStart), + mAliasChannel(aliasChannel) { mDataAvailable=false; mAudioFileName = audioFileName; @@ -314,7 +319,7 @@ // To build the summary data, call ReadData (implemented by the // derived classes) to get the sample data - samplePtr sampleData = NewSamples(mLen, floatSample); + samplePtr sampleData;// = NewSamples(mLen, floatSample); //use the decoder here. mDecoderMutex.Lock(); @@ -324,22 +329,23 @@ mDecoderMutex.Unlock(); return; } - mDecoder->Decode(sampleData, mFormat, mDecodeFileStart, mLen); + mDecoder->Decode(sampleData, mFormat, mDecodeFileStart, mLen, mAliasChannel); mDecoderMutex.Unlock(); - this->ReadData(sampleData, floatSample, 0, mLen); +//calc summary is done in WriteSimpleBlockFile +// this->ReadData(sampleData, floatSample, 0, mLen); - void *summaryData = CalcSummary(sampleData, mLen, floatSample); +// void *summaryData = CalcSummary(sampleData, mLen, floatSample); //OD TODO: use new write() // summaryFile.Write(summaryData, mSummaryInfo.totalSummaryBytes); WriteSimpleBlockFile( sampleData, mLen, mFormat, - summaryData); + NULL);//summaryData); DeleteSamples(sampleData); - delete [] (char *) summaryData; +// delete [] (char *) summaryData; mDataAvailableMutex.Lock(); Index: SimpleBlockFile.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/blockfile/SimpleBlockFile.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- SimpleBlockFile.cpp 13 Mar 2009 06:14:00 -0000 1.29 +++ SimpleBlockFile.cpp 8 Oct 2009 14:32:09 -0000 1.30 @@ -104,14 +104,15 @@ SimpleBlockFile::SimpleBlockFile(wxFileName baseFileName, samplePtr sampleData, sampleCount sampleLen, sampleFormat format, - bool allowDeferredWrite /* = false */): + bool allowDeferredWrite /* = false */, + bool bypassCache /* = false */): BlockFile(wxFileName(baseFileName.GetFullPath() + wxT(".au")), sampleLen) { mCache.active = false; DEBUG_OUTPUT("SimpleBlockFile created based on sample data"); - bool useCache = GetCache(); + bool useCache = GetCache() && (!bypassCache); if (!(allowDeferredWrite && useCache)) WriteSimpleBlockFile(sampleData, sampleLen, format, NULL); Index: ODDecodeBlockFile.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/blockfile/ODDecodeBlockFile.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ODDecodeBlockFile.h 14 Aug 2008 15:50:06 -0000 1.3 +++ ODDecodeBlockFile.h 8 Oct 2009 14:32:09 -0000 1.4 @@ -42,12 +42,11 @@ // Constructor / Destructor /// Create a disk file and write summary and sample data to it - ODDecodeBlockFile(wxFileName baseFileName, wxFileName audioFileName, - samplePtr sampleData, sampleCount sampleLen, - sampleFormat format, - bool allowDeferredWrite = false); + ODDecodeBlockFile(wxFileName baseFileName,wxFileName audioFileName, sampleCount aliasStart, + sampleCount aliasLen, int aliasChannel); /// Create the memory structure to refer to the given block file - ODDecodeBlockFile(wxFileName existingFile, wxFileName audioFileName, sampleCount len, + ODDecodeBlockFile(wxFileName existingFile, wxFileName audioFileName, sampleCount aliasStart, + sampleCount aliasLen, int aliasChannel, float min, float max, float rms); virtual ~ODDecodeBlockFile(); @@ -149,6 +148,9 @@ sampleFormat mFormat; sampleCount mDecodeFileStart; + + sampleCount mAliasStart;//where in the encoded audio file this block corresponds to. + int mAliasChannel;//The channel number in the encoded file.. }; Index: SimpleBlockFile.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/blockfile/SimpleBlockFile.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- SimpleBlockFile.h 14 Aug 2008 15:50:06 -0000 1.13 +++ SimpleBlockFile.h 8 Oct 2009 14:32:09 -0000 1.14 @@ -51,7 +51,8 @@ SimpleBlockFile(wxFileName baseFileName, samplePtr sampleData, sampleCount sampleLen, sampleFormat format, - bool allowDeferredWrite = false); + bool allowDeferredWrite = false, + bool bypassCache = false ); /// Create the memory structure to refer to the given block file SimpleBlockFile(wxFileName existingFile, sampleCount len, float min, float max, float rms); ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs