Update of /cvsroot/audacity/audacity-src/src/ondemand In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18963/ondemand
Modified Files: ODComputeSummaryTask.h ODDecodeFlacTask.h ODDecodeTask.cpp ODDecodeTask.h ODTask.h Log Message: Checking in saving ability for FLAC on-demand loading. Index: ODDecodeTask.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/ondemand/ODDecodeTask.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ODDecodeTask.h 9 Oct 2009 14:28:49 -0000 1.6 +++ ODDecodeTask.h 11 Oct 2009 14:55:47 -0000 1.7 @@ -40,13 +40,6 @@ class ODDecodeTask:public ODTask { public: - enum { - eODNone, - eODFLAC, - eODMP3, - eODOTHER - } ODDecodeTypeEnum; - // Constructor / Destructor /// Constructs an ODTask @@ -61,14 +54,14 @@ virtual const wxChar* GetTip(){return _("Decoding Waveform");} ///Subclasses should override to return respective type. - virtual int GetDecodeType(){return eODNone;} + virtual unsigned int GetODType(){return eODNone;} ///Creates an ODFileDecoder that decodes a file of filetype the subclass handles. virtual ODFileDecoder* CreateFileDecoder(const wxString & fileName)=0; ///there could be the ODBlockFiles of several FLACs in one track (after copy and pasting) ///so we keep a list of decoders that keep track of the file names, etc, and check the blocks against them. - ///Blocks that have IsDataAvailable()==false are blockfiles to be decoded. if BlockFile::GetDecodeType()==ODDecodeTask::GetDecodeType() then + ///Blocks that have IsDataAvailable()==false are blockfiles to be decoded. if BlockFile::GetDecodeType()==ODDecodeTask::GetODType() then ///this decoder should handle it. Decoders are accessible with the methods below. These aren't thread-safe and should only ///be called from the decoding thread. virtual ODFileDecoder* GetOrCreateMatchingFileDecoder(ODDecodeBlockFile* blockFile); Index: ODComputeSummaryTask.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/ondemand/ODComputeSummaryTask.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ODComputeSummaryTask.h 9 Oct 2008 18:13:03 -0000 1.10 +++ ODComputeSummaryTask.h 11 Oct 2009 14:55:47 -0000 1.11 @@ -41,6 +41,9 @@ virtual ODTask* Clone(); + ///Subclasses should override to return respective type. + virtual unsigned int GetODType(){return eODPCMSummary;} + ///Return the task name virtual const char* GetTaskName(){return "ODComputeSummaryTask";} Index: ODTask.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/ondemand/ODTask.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ODTask.h 23 Aug 2008 23:14:04 -0000 1.14 +++ ODTask.h 11 Oct 2009 14:55:47 -0000 1.15 @@ -38,7 +38,14 @@ class ODTask { public: - + enum { + eODNone = 0x00000000, + eODFLAC = 0x00000001, + eODMP3 = 0x00000002, + eODFFMPEG = 0x00000004, + eODPCMSummary = 0x00001000, + eODOTHER = 0x10000000, + } ODTypeEnum; // Constructor / Destructor /// Constructs an ODTask @@ -49,6 +56,10 @@ //clones everything except information about the tracks. virtual ODTask* Clone()=0; + ///Subclasses should override to return respective type. + virtual unsigned int GetODType(){return eODNone;} + + ///Do a modular part of the task. For example, if the task is to load the entire file, load one BlockFile. ///Relies on DoSomeInternal(), which is the subclasses must implement. ///@param amountWork the percent amount of the total job to do. 1.0 represents the entire job. the default of 0.0 Index: ODDecodeTask.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/ondemand/ODDecodeTask.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ODDecodeTask.cpp 9 Oct 2009 14:28:49 -0000 1.6 +++ ODDecodeTask.cpp 11 Oct 2009 14:55:47 -0000 1.7 @@ -144,7 +144,7 @@ for(i=0; i<(int)blocks->GetCount(); i++) { //since we have more than one ODBlockFile, we will need type flags to cast. - if(!blocks->Item(i)->f->IsDataAvailable() && ((ODDecodeBlockFile*)blocks->Item(i)->f)->GetDecodeType()==this->GetDecodeType()) + if(!blocks->Item(i)->f->IsDataAvailable() && ((ODDecodeBlockFile*)blocks->Item(i)->f)->GetDecodeType()==this->GetODType()) { blocks->Item(i)->f->Ref(); ((ODDecodeBlockFile*)blocks->Item(i)->f)->SetStart(blocks->Item(i)->start); @@ -231,7 +231,7 @@ ///there could be the ODBlockFiles of several FLACs in one track (after copy and pasting) ///so we keep a list of decoders that keep track of the file names, etc, and check the blocks against them. -///Blocks that have IsDataAvailable()==false are blockfiles to be decoded. if BlockFile::GetDecodeType()==ODDecodeTask::GetDecodeType() then +///Blocks that have IsDataAvailable()==false are blockfiles to be decoded. if BlockFile::GetDecodeType()==ODDecodeTask::GetODType() then ///this decoder should handle it. Decoders are accessible with the methods below. These aren't thread-safe and should only ///be called from the decoding thread. ODFileDecoder* ODDecodeTask::GetOrCreateMatchingFileDecoder(ODDecodeBlockFile* blockFile) Index: ODDecodeFlacTask.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/ondemand/ODDecodeFlacTask.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ODDecodeFlacTask.h 9 Oct 2009 14:28:49 -0000 1.5 +++ ODDecodeFlacTask.h 11 Oct 2009 14:55:47 -0000 1.6 @@ -57,7 +57,7 @@ ///Lets other classes know that this class handles flac ///Subclasses should override to return respective type. - virtual int GetDecodeType(){return eODFLAC;} + virtual unsigned int GetODType(){return eODFLAC;} }; ------------------------------------------------------------------------------ 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