Audacity  3.0.3
Public Member Functions | Protected Member Functions | List of all members
SampleBlock Class Referenceabstract

Abstract class allows access to contents of a block of sound samples, serialization as XML, and reference count management that can suppress reclamation of its storage. More...

#include <SampleBlock.h>

Inheritance diagram for SampleBlock:
[legend]

Public Member Functions

virtual ~SampleBlock ()
 
virtual void CloseLock ()=0
 
virtual SampleBlockID GetBlockID () const =0
 
size_t GetSamples (samplePtr dest, sampleFormat destformat, size_t sampleoffset, size_t numsamples, bool mayThrow=true)
 
virtual size_t GetSampleCount () const =0
 
virtual bool GetSummary256 (float *dest, size_t frameoffset, size_t numframes)=0
 Non-throwing, should fill with zeroes on failure. More...
 
virtual bool GetSummary64k (float *dest, size_t frameoffset, size_t numframes)=0
 Non-throwing, should fill with zeroes on failure. More...
 
MinMaxRMS GetMinMaxRMS (size_t start, size_t len, bool mayThrow=true)
 Gets extreme values for the specified region. More...
 
MinMaxRMS GetMinMaxRMS (bool mayThrow=true) const
 Gets extreme values for the entire block. More...
 
virtual size_t GetSpaceUsage () const =0
 
virtual void SaveXML (XMLWriter &xmlFile)=0
 

Protected Member Functions

virtual size_t DoGetSamples (samplePtr dest, sampleFormat destformat, size_t sampleoffset, size_t numsamples)=0
 
virtual MinMaxRMS DoGetMinMaxRMS (size_t start, size_t len)=0
 
virtual MinMaxRMS DoGetMinMaxRMS () const =0
 

Detailed Description

Abstract class allows access to contents of a block of sound samples, serialization as XML, and reference count management that can suppress reclamation of its storage.

Definition at line 44 of file SampleBlock.h.

Constructor & Destructor Documentation

◆ ~SampleBlock()

SampleBlock::~SampleBlock ( )
virtualdefault

Member Function Documentation

◆ CloseLock()

virtual void SampleBlock::CloseLock ( )
pure virtual

Implemented in SqliteSampleBlock.

◆ DoGetMinMaxRMS() [1/2]

virtual MinMaxRMS SampleBlock::DoGetMinMaxRMS ( ) const
protectedpure virtual

Implemented in SqliteSampleBlock.

Referenced by GetMinMaxRMS().

Here is the caller graph for this function:

◆ DoGetMinMaxRMS() [2/2]

virtual MinMaxRMS SampleBlock::DoGetMinMaxRMS ( size_t  start,
size_t  len 
)
protectedpure virtual

Implemented in SqliteSampleBlock.

◆ DoGetSamples()

virtual size_t SampleBlock::DoGetSamples ( samplePtr  dest,
sampleFormat  destformat,
size_t  sampleoffset,
size_t  numsamples 
)
protectedpure virtual

Implemented in SqliteSampleBlock.

Referenced by GetSamples().

Here is the caller graph for this function:

◆ GetBlockID()

virtual SampleBlockID SampleBlock::GetBlockID ( ) const
pure virtual

Implemented in SqliteSampleBlock.

Referenced by UndoManager::EstimateRemovedBlocks().

Here is the caller graph for this function:

◆ GetMinMaxRMS() [1/2]

MinMaxRMS SampleBlock::GetMinMaxRMS ( bool  mayThrow = true) const

Gets extreme values for the entire block.

Definition at line 98 of file SampleBlock.cpp.

99 {
100  try{ return DoGetMinMaxRMS(); }
101  catch( ... ) {
102  if( mayThrow )
103  throw;
104  return {};
105  }
106 }

References DoGetMinMaxRMS().

Here is the call graph for this function:

◆ GetMinMaxRMS() [2/2]

MinMaxRMS SampleBlock::GetMinMaxRMS ( size_t  start,
size_t  len,
bool  mayThrow = true 
)

Gets extreme values for the specified region.

Definition at line 87 of file SampleBlock.cpp.

89 {
90  try{ return DoGetMinMaxRMS(start, len); }
91  catch( ... ) {
92  if( mayThrow )
93  throw;
94  return {};
95  }
96 }

References DoGetMinMaxRMS().

Here is the call graph for this function:

◆ GetSampleCount()

virtual size_t SampleBlock::GetSampleCount ( ) const
pure virtual

Implemented in SqliteSampleBlock.

◆ GetSamples()

size_t SampleBlock::GetSamples ( samplePtr  dest,
sampleFormat  destformat,
size_t  sampleoffset,
size_t  numsamples,
bool  mayThrow = true 
)

Definition at line 73 of file SampleBlock.cpp.

77 {
78  try{ return DoGetSamples(dest, destformat, sampleoffset, numsamples); }
79  catch( ... ) {
80  if( mayThrow )
81  throw;
82  ClearSamples( dest, destformat, 0, numsamples );
83  return 0;
84  }
85 }

References ClearSamples(), and DoGetSamples().

Here is the call graph for this function:

◆ GetSpaceUsage()

virtual size_t SampleBlock::GetSpaceUsage ( ) const
pure virtual

Implemented in SqliteSampleBlock.

◆ GetSummary256()

virtual bool SampleBlock::GetSummary256 ( float *  dest,
size_t  frameoffset,
size_t  numframes 
)
pure virtual

Non-throwing, should fill with zeroes on failure.

Implemented in SqliteSampleBlock.

◆ GetSummary64k()

virtual bool SampleBlock::GetSummary64k ( float *  dest,
size_t  frameoffset,
size_t  numframes 
)
pure virtual

Non-throwing, should fill with zeroes on failure.

Implemented in SqliteSampleBlock.

◆ SaveXML()

virtual void SampleBlock::SaveXML ( XMLWriter xmlFile)
pure virtual

Implemented in SqliteSampleBlock.


The documentation for this class was generated from the following files:
ClearSamples
void ClearSamples(samplePtr dst, sampleFormat format, size_t start, size_t len)
Definition: SampleFormat.cpp:77
SampleBlock::DoGetSamples
virtual size_t DoGetSamples(samplePtr dest, sampleFormat destformat, size_t sampleoffset, size_t numsamples)=0
SampleBlock::DoGetMinMaxRMS
virtual MinMaxRMS DoGetMinMaxRMS() const =0