Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8261
Modified Files: DirManager.cpp DirManager.h Experimental.h Sequence.cpp Sequence.h WaveClip.cpp WaveClip.h WaveTrack.cpp WaveTrack.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: DirManager.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/DirManager.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- DirManager.h 14 Oct 2008 18:05:16 -0000 1.37 +++ DirManager.h 8 Oct 2009 14:32:09 -0000 1.38 @@ -63,6 +63,9 @@ BlockFile *NewODAliasBlockFile( wxString aliasedFile, sampleCount aliasStart, sampleCount aliasLen, int aliasChannel); + + BlockFile *NewODDecodeBlockFile( wxString aliasedFile, sampleCount aliasStart, + sampleCount aliasLen, int aliasChannel); // Adds one to the reference count of the block file, // UNLESS it is "locked", then it makes a new copy of Index: WaveClip.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/WaveClip.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- WaveClip.h 22 Sep 2009 00:18:11 -0000 1.38 +++ WaveClip.h 8 Oct 2009 14:32:09 -0000 1.39 @@ -149,6 +149,9 @@ bool AppendAlias(wxString fName, sampleCount start, sampleCount len, int channel,bool useOD); + + bool AppendCoded(wxString fName, sampleCount start, + sampleCount len, int channel); /// This name is consistent with WaveTrack::Clear. It performs a "Cut" /// operation (but without putting the cutted audio to the clipboard) Index: Sequence.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Sequence.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Sequence.h 29 Mar 2009 03:10:41 -0000 1.22 +++ Sequence.h 8 Oct 2009 14:32:09 -0000 1.23 @@ -88,6 +88,9 @@ bool AppendAlias(wxString fullPath, sampleCount start, sampleCount len, int channel,bool useOD); + + bool AppendCoded(wxString fName, sampleCount start, + sampleCount len, int channel); // Append a blockfile. The blockfile pointer is then "owned" by the // sequence. This function is used by the recording log crash recovery Index: Experimental.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Experimental.h,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- Experimental.h 28 Aug 2009 14:44:28 -0000 1.65 +++ Experimental.h 8 Oct 2009 14:32:09 -0000 1.66 @@ -75,6 +75,12 @@ // Allow keyboard seeking before initial playback position //#define EXPERIMENTAL_SEEK_BEHIND_CURSOR +// Michael Chinen, 08.Oct 2009 +// use on-demand importing for FLAC. If you don't want to recompile the whole src tree +// just go to the top of ImportFlac.cpp and stick this define there, since currently it +// is the only one that uses it. +//#define EXPERIMENTAL_OD_FLAC + // Philip Van Baren 01 July 2009 // Replace RealFFT() and PowerSpectrum function to use (faster) RealFFTf function #define EXPERIMENTAL_USE_REALFFTF Index: WaveTrack.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.h,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- WaveTrack.h 16 Aug 2009 14:44:20 -0000 1.73 +++ WaveTrack.h 8 Oct 2009 14:32:09 -0000 1.74 @@ -178,6 +178,10 @@ bool AppendAlias(wxString fName, sampleCount start, sampleCount len, int channel,bool useOD); + + ///for use with On-Demand decoding of compressed files + bool AppendCoded(wxString fName, sampleCount start, + sampleCount len, int channel); ///Deletes all clips' wavecaches. Careful, This may not be threadsafe. void DeleteWaveCaches(); Index: WaveTrack.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.cpp,v retrieving revision 1.166 retrieving revision 1.167 diff -u -d -r1.166 -r1.167 --- WaveTrack.cpp 23 Aug 2009 11:22:28 -0000 1.166 +++ WaveTrack.cpp 8 Oct 2009 14:32:09 -0000 1.167 @@ -1288,6 +1288,13 @@ return GetLastOrCreateClip()->AppendAlias(fName, start, len, channel,useOD); } + +bool WaveTrack::AppendCoded(wxString fName, sampleCount start, + sampleCount len, int channel) +{ + return GetLastOrCreateClip()->AppendCoded(fName, start, len, channel); +} + sampleCount WaveTrack::GetBestBlockSize(sampleCount s) { sampleCount bestBlockSize = GetMaxBlockSize(); Index: DirManager.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/DirManager.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- DirManager.cpp 19 Sep 2009 19:41:28 -0000 1.89 +++ DirManager.cpp 8 Oct 2009 14:32:09 -0000 1.90 @@ -68,6 +68,7 @@ #include "blockfile/SilentBlockFile.h" #include "blockfile/PCMAliasBlockFile.h" #include "blockfile/ODPCMAliasBlockFile.h" +#include "blockfile/ODDecodeBlockFile.h" #include "DirManager.h" #include "Internat.h" #include "Project.h" @@ -797,6 +798,23 @@ return newBlockFile; } +BlockFile *DirManager::NewODDecodeBlockFile( + wxString aliasedFile, sampleCount aliasStart, + sampleCount aliasLen, int aliasChannel) +{ + wxFileName fileName = MakeBlockFileName(); + + BlockFile *newBlockFile = + new ODDecodeBlockFile(fileName, + aliasedFile, aliasStart, aliasLen, aliasChannel); + + blockFileHash[fileName.GetName()]=newBlockFile; + aliasList.Add(aliasedFile); //OD TODO: check to see if we need to remove this when done decoding. + //I don't immediately see a place where alias files remove when a file is closed. + + return newBlockFile; +} + // Adds one to the reference count of the block file, // UNLESS it is "locked", then it makes a new copy of // the BlockFile. Index: Sequence.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Sequence.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- Sequence.cpp 5 Apr 2009 22:52:22 -0000 1.57 +++ Sequence.cpp 8 Oct 2009 14:32:09 -0000 1.58 @@ -628,6 +628,23 @@ return true; } +bool Sequence::AppendCoded(wxString fName, sampleCount start, + sampleCount len, int channel) +{ + // Quick check to make sure that it doesn't overflow + if (((double)mNumSamples) + ((double)len) > wxLL(9223372036854775807)) + return false; + + SeqBlock *newBlock = new SeqBlock(); + + newBlock->start = mNumSamples; + newBlock->f = mDirManager->NewODDecodeBlockFile(fName, start, len, channel); + mBlock->Add(newBlock); + mNumSamples += newBlock->f->GetLength(); + + return true; +} + bool Sequence::AppendBlock(SeqBlock * b) { // Quick check to make sure that it doesn't overflow Index: WaveClip.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/WaveClip.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- WaveClip.cpp 22 Sep 2009 00:18:11 -0000 1.55 +++ WaveClip.cpp 8 Oct 2009 14:32:09 -0000 1.56 @@ -1074,6 +1074,18 @@ return result; } +bool WaveClip::AppendCoded(wxString fName, sampleCount start, + sampleCount len, int channel) +{ + bool result = mSequence->AppendCoded(fName, start, len, channel); + if (result) + { + UpdateEnvelopeTrackLen(); + MarkChanged(); + } + return result; +} + bool WaveClip::Flush() { //wxLogDebug(wxT("Flush!")); ------------------------------------------------------------------------------ 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