|
Audacity
3.0.3
|
Go to the documentation of this file.
27 #ifndef __AUDACITY_ODDecodeBlockFile__
28 #define __AUDACITY_ODDecodeBlockFile__
31 #include <wx/atomic.h>
44 size_t aliasLen,
int aliasChannel,
unsigned int decodeType);
47 size_t aliasLen,
int aliasChannel,
unsigned int decodeType,
48 float min,
float max,
float rms,
bool dataAvailable);
67 size_t start,
size_t len,
bool mayThrow)
const override;
71 bool Read256(
float *buffer,
size_t start,
size_t len)
override;
73 bool Read64K(
float *buffer,
size_t start,
size_t len)
override;
87 static BlockFilePtr
BuildFromXML(DirManager &dm,
const wxChar **attrs);
112 size_t start,
size_t len,
bool mayThrow)
const override;
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
void SetFileName(wxFileNameWrapper &&name) override
sets the file name the summary info will be saved in. threadsafe.
virtual ~ODDecodeBlockFile()
void UnlockRead() const override
Allows reading of encoded file on other threads.
void * CalcSummary(samplePtr buffer, size_t len, sampleFormat format, ArrayOf< char > &cleanup) override
virtual bool SeekingAllowed()
void SetExternalFileName(wxFileNameWrapper &&newName) override
const wxString & GetFileName()
An AliasBlockFile that references uncompressed data in an existing file.
const wxFileNameWrapper & GetEncodedAudioFilename() const
void SetStart(sampleCount startSample)
Sets the value that indicates where the first sample in this block corresponds to the global sequence...
GetFileNameResult GetFileName() const override
sets the file name the summary info will be saved in. threadsafe.
sampleCount GetGlobalStart() const
wxFileNameWrapper mAudioFileName
The original file the audio came from.
bool Read64K(float *buffer, size_t start, size_t len) override
Returns the 64K summary data block.
void SetClipOffset(sampleCount numSamples)
sets the amount of samples the clip associated with this blockfile is offset in the wavetrack (non ef...
wxAtomicInt mDataAvailable
sampleCount mClipOffset
the ODTask needs to know where this blockfile lies in the track, so for convenience,...
void MarkInitialized()
Derived classes should call this after they have parsed the header.
DiskByteCount GetSpaceUsage() const override
A BlockFile that reads and writes uncompressed data using libsndfile.
void LockRead() const override
Prevents a read on other threads of the encoded audio file.
unsigned int GetDecodeType() const
Returns the type of audiofile this blockfile is loaded from.
static BlockFilePtr BuildFromXML(DirManager &dm, const wxChar **attrs)
Reconstructs from XML a ODDecodeBlockFile and reschedules it for OD loading.
unsigned int mNumChannels
MinMaxRMS GetMinMaxRMS(size_t start, size_t len, bool mayThrow) const override
Gets extreme values for the specified region.
ODLock mReadDataMutex
For accessing the audio file that will be decoded. Used by dir manager;.
const TranslatableString name
ODFileDecoder(const wxString &fName)
This should handle unicode converted to UTF-8 on mac/linux, but OD TODO:check on windows.
virtual int Decode(SampleBuffer &data, sampleFormat &format, sampleCount start, size_t len, unsigned int channel)=0
sampleCount GetGlobalEnd() const
void ChangeAudioFile(wxFileNameWrapper &&newAudioFile)
ODDecodeBlockFile(wxFileNameWrapper &&baseFileName, wxFileNameWrapper &&audioFileName, sampleCount aliasStart, size_t aliasLen, int aliasChannel, unsigned int decodeType)
Create a disk file and write summary and sample data to it.
bool IsSummaryAvailable() const override
sampleCount GetStart() const
Gets the value that indicates where the first sample in this block corresponds to the global sequence...
bool IsDataAvailable() const override
Returns TRUE if this block's complete data is ready to be accessed by Read()
class to decode a particular file (one per file). Saves info such as filename and length (after the h...
bool ReadSummary(ArrayOf< char > &data) override
Read the summary into a buffer.
sampleCount mStart
for reporting after task is complete. Only for display use.
Positions or offsets within audio files need a wide type.
void SaveXML(XMLWriter &xmlFile) override
Saves as xml ODDecodeBlockFile or SimpleBlockFile depending on summary availability.
virtual bool ReadHeader()=0
bool Read256(float *buffer, size_t start, size_t len) override
Returns the 256 byte summary data block.
size_t ReadData(samplePtr data, sampleFormat format, size_t start, size_t len, bool mayThrow) const override
Reads the specified data from the aliased file using libsndfile.
const wxFileName & GetAudioFileName()
BlockFilePtr Copy(wxFileNameWrapper &&fileName) override
Makes NEW ODDecodeBlockFile or SimpleBlockFile depending on summary availability.
void SetODFileDecoder(ODFileDecoder *decoder)
set the decoder,
void Recover(void) override
Writes the summary file if summary data is available.
bool IsSummaryBeingComputed() override
Returns TRUE if the summary has not yet been written, but is actively being computed and written to d...
sampleCount GetClipOffset() const
Gets the number of samples the clip associated with this blockfile is offset by.
const wxFileNameWrapper & GetExternalFileName() const override
int WriteODDecodeBlockFile()