Audacity  2.2.0
PCMAliasBlockFile Class Reference

An AliasBlockFile that references uncompressed data in an existing file. More...

#include <PCMAliasBlockFile.h>

Inheritance diagram for PCMAliasBlockFile:
AliasBlockFile BlockFile LegacyAliasBlockFile ODPCMAliasBlockFile

Public Member Functions

 PCMAliasBlockFile (wxFileNameWrapper &&baseFileName, wxFileNameWrapper &&aliasedFileName, sampleCount aliasStart, size_t aliasLen, int aliasChannel)
 Constructs a PCMAliasBlockFile, writing the summary to disk. More...
 
 PCMAliasBlockFile (wxFileNameWrapper &&fileName, wxFileNameWrapper &&aliasedFileName, sampleCount aliasStart, size_t aliasLen, int aliasChannel, bool writeSummary)
 Constructs a PCMAliasBlockFile with the option of not writing to disk. More...
 
 PCMAliasBlockFile (wxFileNameWrapper &&existingSummaryFileName, wxFileNameWrapper &&aliasedFileName, sampleCount aliasStart, size_t aliasLen, int aliasChannel, float min, float max, float rms)
 
virtual ~PCMAliasBlockFile ()
 
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. More...
 
void SaveXML (XMLWriter &xmlFile) override
 Stores a representation of this file in XML. More...
 
BlockFilePtr Copy (wxFileNameWrapper &&fileName) override
 
void Recover () override
 if the on-disk state disappeared, either recover it (if it was More...
 
- Public Member Functions inherited from AliasBlockFile
 AliasBlockFile (wxFileNameWrapper &&baseFileName, wxFileNameWrapper &&aliasedFileName, sampleCount aliasStart, size_t aliasLen, int aliasChannel)
 Constructs an AliasBlockFile. More...
 
 AliasBlockFile (wxFileNameWrapper &&existingSummaryFileName, wxFileNameWrapper &&aliasedFileName, sampleCount aliasStart, size_t aliasLen, int aliasChannel, float min, float max, float RMS)
 
virtual ~AliasBlockFile ()
 
DiskByteCount GetSpaceUsage () const override
 
void SilenceAliasLog () const
 as SilentLog (which would affect Summary data access), but More...
 
const wxFileName & GetAliasedFileName () const
 
void ChangeAliasedFileName (wxFileNameWrapper &&newAliasedFile)
 
bool IsAlias () const override
 Returns TRUE if this block references another disk file. More...
 
- Public Member Functions inherited from BlockFile
 BlockFile (wxFileNameWrapper &&fileName, size_t samples)
 Construct a BlockFile. More...
 
virtual ~BlockFile ()
 
virtual bool GetNeedWriteCacheToDisk ()
 
virtual void WriteCacheToDisk ()
 
virtual bool GetNeedFillCache ()
 
virtual void FillCache ()
 
virtual GetFileNameResult GetFileName () const
 
virtual void SetFileName (wxFileNameWrapper &&name)
 sets the file name the summary info will be saved in. threadsafe. More...
 
size_t GetLength () const
 
void SetLength (size_t newLen)
 
virtual void Lock ()
 Locks this BlockFile, to prevent it from being moved. More...
 
virtual void Unlock ()
 Unlock this BlockFile, allowing it to be moved. More...
 
virtual bool IsLocked ()
 Returns TRUE if this BlockFile is locked. More...
 
virtual MinMaxRMS GetMinMaxRMS (size_t start, size_t len, bool mayThrow=true) const
 Gets extreme values for the specified region. More...
 
virtual MinMaxRMS GetMinMaxRMS (bool mayThrow=true) const
 Gets extreme values for the entire block. More...
 
virtual bool Read256 (float *buffer, size_t start, size_t len)
 Returns the 256 byte summary data block. More...
 
virtual bool Read64K (float *buffer, size_t start, size_t len)
 Returns the 64K summary data block. More...
 
virtual bool IsSummaryAvailable () const
 Returns TRUE if this block's complete summary has been computed and is ready (for OD) More...
 
virtual bool IsDataAvailable () const
 Returns TRUE if this block's complete data is ready to be accessed by Read() More...
 
virtual bool IsSummaryBeingComputed ()
 Returns TRUE if the summary has not yet been written, but is actively being computed and written to disk. More...
 
void SilenceLog () const
 if we've detected an on-disk problem, the user opted to More...
 
virtual void CloseLock ()
 
ReadLock LockForRead () const
 

Static Public Member Functions

static BlockFilePtr BuildFromXML (DirManager &dm, const wxChar **attrs)
 

Additional Inherited Members

- Public Types inherited from BlockFile
using DiskByteCount = unsigned long long
 
- Static Public Attributes inherited from BlockFile
static unsigned long gBlockFileDestructionCount { 0 }
 
- Protected Types inherited from BlockFile
using ReadLockBase = movable_ptr_with_deleter< const BlockFile, ReadUnlocker >
 
- Protected Member Functions inherited from AliasBlockFile
virtual void WriteSummary ()
 Write the summary to disk, using the derived ReadData() to get the data. More...
 
bool ReadSummary (ArrayOf< char > &data) override
 Read the summary into a buffer. More...
 
- Protected Member Functions inherited from BlockFile
virtual void LockRead () const
 Prevents a read on other threads. The basic blockfile runs on only one thread, so does nothing. More...
 
virtual void UnlockRead () const
 Allows reading on other threads. More...
 
virtual void * CalcSummary (samplePtr buffer, size_t len, sampleFormat format, ArrayOf< char > &cleanup)
 
void CalcSummaryFromBuffer (const float *fbuffer, size_t len, float *summary256, float *summary64K)
 
virtual void FixSummary (void *data)
 
- Static Protected Member Functions inherited from BlockFile
static size_t CommonReadData (bool mayThrow, const wxFileName &fileName, bool &mSilentLog, const AliasBlockFile *pAliasFile, sampleCount origin, unsigned channel, samplePtr data, sampleFormat format, size_t start, size_t len, const sampleFormat *pLegacyFormat=nullptr, size_t legacyLen=0)
 
- Protected Attributes inherited from AliasBlockFile
wxFileNameWrapper mAliasedFileName
 
sampleCount mAliasStart
 
const int mAliasChannel
 
bool mSilentAliasLog
 
- Protected Attributes inherited from BlockFile
wxFileNameWrapper mFileName
 
size_t mLen
 
SummaryInfo mSummaryInfo
 
float mMin
 
float mMax
 
float mRMS
 
bool mSilentLog
 

Detailed Description

An AliasBlockFile that references uncompressed data in an existing file.

Constructor & Destructor Documentation

PCMAliasBlockFile::PCMAliasBlockFile ( wxFileNameWrapper &&  baseFileName,
wxFileNameWrapper &&  aliasedFileName,
sampleCount  aliasStart,
size_t  aliasLen,
int  aliasChannel 
)

Constructs a PCMAliasBlockFile, writing the summary to disk.

PCMAliasBlockFile::PCMAliasBlockFile ( wxFileNameWrapper &&  fileName,
wxFileNameWrapper &&  aliasedFileName,
sampleCount  aliasStart,
size_t  aliasLen,
int  aliasChannel,
bool  writeSummary 
)

Constructs a PCMAliasBlockFile with the option of not writing to disk.

PCMAliasBlockFile::PCMAliasBlockFile ( wxFileNameWrapper &&  existingSummaryFileName,
wxFileNameWrapper &&  aliasedFileName,
sampleCount  aliasStart,
size_t  aliasLen,
int  aliasChannel,
float  min,
float  max,
float  rms 
)

References min().

PCMAliasBlockFile::~PCMAliasBlockFile ( )
virtual

Member Function Documentation

BlockFilePtr PCMAliasBlockFile::Copy ( wxFileNameWrapper &&  newFileName)
overridevirtual

Construct a NEW PCMAliasBlockFile based on this one, but writing the summary data to a NEW file.

Parameters
newFileNameThe filename to copy the summary data to.

Implements BlockFile.

References AliasBlockFile::mAliasChannel, AliasBlockFile::mAliasedFileName, AliasBlockFile::mAliasStart, BlockFile::mLen, BlockFile::mMax, BlockFile::mMin, and BlockFile::mRMS.

size_t PCMAliasBlockFile::ReadData ( samplePtr  data,
sampleFormat  format,
size_t  start,
size_t  len,
bool  mayThrow 
) const
overridevirtual

Reads the specified data from the aliased file using libsndfile.

Reads the specified data from the aliased file, using libsndfile, and converts it to the given sample format.

Parameters
dataThe buffer to read the sample data into.
formatThe format to convert the data into
startThe offset within the block to begin reading
lenThe number of samples to read

Implements BlockFile.

References BlockFile::CommonReadData(), AliasBlockFile::mAliasChannel, AliasBlockFile::mAliasedFileName, AliasBlockFile::mAliasStart, and AliasBlockFile::mSilentAliasLog.

void PCMAliasBlockFile::Recover ( )
overridevirtual

if the on-disk state disappeared, either recover it (if it was

Implements BlockFile.

References AliasBlockFile::WriteSummary().


The documentation for this class was generated from the following files: