mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 09:01:15 +02:00
Campbell Barton's further patch to turn many, many tabs to our 3-space convenbtion
This commit is contained in:
@@ -71,14 +71,14 @@ void ODFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata)
|
||||
}
|
||||
mDecoder->mStreamInfoDone=true;
|
||||
break;
|
||||
// handle the other types we do nothing with to avoid a warning
|
||||
case FLAC__METADATA_TYPE_PADDING: // do nothing with padding
|
||||
case FLAC__METADATA_TYPE_APPLICATION: // no idea what to do with this
|
||||
case FLAC__METADATA_TYPE_SEEKTABLE: // don't need a seektable here
|
||||
case FLAC__METADATA_TYPE_CUESHEET: // convert this to labels?
|
||||
case FLAC__METADATA_TYPE_PICTURE: // ignore pictures
|
||||
case FLAC__METADATA_TYPE_UNDEFINED: // do nothing with this either
|
||||
break;
|
||||
// handle the other types we do nothing with to avoid a warning
|
||||
case FLAC__METADATA_TYPE_PADDING: // do nothing with padding
|
||||
case FLAC__METADATA_TYPE_APPLICATION: // no idea what to do with this
|
||||
case FLAC__METADATA_TYPE_SEEKTABLE: // don't need a seektable here
|
||||
case FLAC__METADATA_TYPE_CUESHEET: // convert this to labels?
|
||||
case FLAC__METADATA_TYPE_PICTURE: // ignore pictures
|
||||
case FLAC__METADATA_TYPE_UNDEFINED: // do nothing with this either
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ int ODFlacDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount s
|
||||
|
||||
mDecodeBufferWritePosition=0;
|
||||
mDecodeBufferLen = len;
|
||||
|
||||
|
||||
data = NewSamples(len, mFormat);
|
||||
mDecodeBuffer=data;
|
||||
format = mFormat;
|
||||
@@ -241,7 +241,7 @@ bool ODFlacDecoder::ReadHeader()
|
||||
return false;
|
||||
}
|
||||
|
||||
//this will call the metadata_callback when it is done
|
||||
//this will call the metadata_callback when it is done
|
||||
mFile->process_until_end_of_metadata();
|
||||
// not necessary to check state, error callback will catch errors, but here's how:
|
||||
if (mFile->get_state() > FLAC__STREAM_DECODER_READ_FRAME) {
|
||||
@@ -276,7 +276,7 @@ ODFlacDecoder::~ODFlacDecoder(){
|
||||
//compare to FLACImportPlugin::Open(wxString filename)
|
||||
ODFileDecoder* ODDecodeFlacTask::CreateFileDecoder(const wxString & fileName)
|
||||
{
|
||||
// First check if it really is a FLAC file
|
||||
// First check if it really is a FLAC file
|
||||
/*
|
||||
int cnt;
|
||||
wxFile binaryFile;
|
||||
|
@@ -84,7 +84,7 @@ class ODFLACFile : public FLAC::Decoder::File
|
||||
|
||||
protected:
|
||||
virtual FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame,
|
||||
const FLAC__int32 * const buffer[]);
|
||||
const FLAC__int32 * const buffer[]);
|
||||
virtual void metadata_callback(const FLAC__StreamMetadata *metadata);
|
||||
virtual void error_callback(FLAC__StreamDecoderErrorStatus status);
|
||||
};
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
|
||||
private:
|
||||
friend class FLACImportFileHandle;
|
||||
sampleFormat mFormat;
|
||||
sampleFormat mFormat;
|
||||
ODFLACFile *mFile;
|
||||
ODLock mFlacFileLock;//for mFile;
|
||||
wxFFile mHandle;
|
||||
|
@@ -284,7 +284,7 @@ int ODDecodeTask::GetNumFileDecoders()
|
||||
///This should handle unicode converted to UTF-8 on mac/linux, but OD TODO:check on windows
|
||||
ODFileDecoder::ODFileDecoder(const wxString & fName)
|
||||
{
|
||||
mFName = fName;
|
||||
mFName = fName;
|
||||
mInited = false;
|
||||
}
|
||||
|
||||
|
@@ -102,39 +102,39 @@ public:
|
||||
///This should handle unicode converted to UTF-8 on mac/linux, but OD TODO:check on windows
|
||||
ODFileDecoder(const wxString& fName);
|
||||
virtual ~ODFileDecoder();
|
||||
|
||||
|
||||
///Read header. Subclasses must override. Probably should save the info somewhere.
|
||||
///Ideally called once per decoding of a file. This complicates the task because
|
||||
virtual bool ReadHeader()=0;
|
||||
virtual bool Init(){return ReadHeader();}
|
||||
|
||||
///Ideally called once per decoding of a file. This complicates the task because
|
||||
virtual bool ReadHeader()=0;
|
||||
virtual bool Init(){return ReadHeader();}
|
||||
|
||||
virtual bool SeekingAllowed(){return true;}
|
||||
|
||||
///Decodes the samples for this blockfile from the real file into a float buffer.
|
||||
|
||||
///Decodes the samples for this blockfile from the real file into a float buffer.
|
||||
///This is file specific, so subclasses must implement this only.
|
||||
///the buffer should be created by the ODFileDecoder implementing this method.
|
||||
///It should set the format parameter so that the client code can deal with it.
|
||||
///This class should call ReadHeader() first, so it knows the length, and can prepare
|
||||
///the file object if it needs to.
|
||||
///It should set the format parameter so that the client code can deal with it.
|
||||
///This class should call ReadHeader() first, so it knows the length, and can prepare
|
||||
///the file object if it needs to.
|
||||
///returns negative value for failure, 0 or positive value for success.
|
||||
virtual int Decode(samplePtr & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel)=0;
|
||||
|
||||
|
||||
wxString GetFileName(){return mFName;}
|
||||
|
||||
bool IsInitialized();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
///Derived classes should call this after they have parsed the header.
|
||||
void MarkInitialized();
|
||||
|
||||
|
||||
bool mInited;
|
||||
ODLock mInitedLock;
|
||||
|
||||
|
||||
wxString mFName;
|
||||
|
||||
unsigned int mSampleRate;
|
||||
unsigned int mNumSamples;//this may depend on the channel - so TODO: we should probably let the decoder create/modify the track info directly.
|
||||
unsigned int mNumChannels;
|
||||
|
||||
unsigned int mSampleRate;
|
||||
unsigned int mNumSamples;//this may depend on the channel - so TODO: we should probably let the decoder create/modify the track info directly.
|
||||
unsigned int mNumChannels;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -77,7 +77,7 @@ class ODTaskThread {
|
||||
bool mDestroy;
|
||||
pthread_t mThread;
|
||||
|
||||
ODTask* mTask;
|
||||
ODTask* mTask;
|
||||
};
|
||||
|
||||
class ODLock {
|
||||
@@ -125,30 +125,30 @@ protected:
|
||||
#else
|
||||
|
||||
|
||||
class ODTaskThread : public wxThread
|
||||
class ODTaskThread : public wxThread
|
||||
{
|
||||
public:
|
||||
///Constructs a ODTaskThread
|
||||
///@param task the task to be launched as an
|
||||
ODTaskThread(ODTask* task);
|
||||
|
||||
|
||||
///@param task the task to be launched as an
|
||||
ODTaskThread(ODTask* task);
|
||||
|
||||
|
||||
protected:
|
||||
///Executes a part of the task
|
||||
virtual void* Entry();
|
||||
ODTask* mTask;
|
||||
|
||||
ODTask* mTask;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//a wrapper for wxMutex.
|
||||
class AUDACITY_DLL_API ODLock : public wxMutex
|
||||
class AUDACITY_DLL_API ODLock : public wxMutex
|
||||
{
|
||||
public:
|
||||
///Constructs a ODTaskThread
|
||||
///@param task the task to be launched as an
|
||||
ODLock(){}
|
||||
virtual ~ODLock(){}
|
||||
///@param task the task to be launched as an
|
||||
ODLock(){}
|
||||
virtual ~ODLock(){}
|
||||
};
|
||||
|
||||
class ODCondition : public wxCondition
|
||||
|
Reference in New Issue
Block a user