Audacity 3.2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SampleBlockFactory Class Referenceabstract

abstract base class with methods to produce SampleBlock objects More...

#include <SampleBlock.h>

Inheritance diagram for SampleBlockFactory:
[legend]

Classes

struct  Factory
 Global factory of per-project factories of sample blocks. More...
 

Public Types

using SampleBlockIDs = std::unordered_set< SampleBlockID >
 

Public Member Functions

virtual ~SampleBlockFactory ()
 
SampleBlockPtr Create (constSamplePtr src, size_t numsamples, sampleFormat srcformat)
 
SampleBlockPtr CreateSilent (size_t numsamples, sampleFormat srcformat)
 
SampleBlockPtr CreateFromXML (sampleFormat srcformat, const AttributesList &attrs)
 
virtual SampleBlockIDs GetActiveBlockIDs ()=0
 

Static Public Member Functions

static SampleBlockFactoryPtr New (AudacityProject &project)
 

Protected Member Functions

virtual SampleBlockPtr DoCreate (constSamplePtr src, size_t numsamples, sampleFormat srcformat)=0
 
virtual SampleBlockPtr DoCreateSilent (size_t numsamples, sampleFormat srcformat)=0
 
virtual SampleBlockPtr DoCreateFromXML (sampleFormat srcformat, const AttributesList &attrs)=0
 

Detailed Description

abstract base class with methods to produce SampleBlock objects

Definition at line 109 of file SampleBlock.h.

Member Typedef Documentation

◆ SampleBlockIDs

Definition at line 137 of file SampleBlock.h.

Constructor & Destructor Documentation

◆ ~SampleBlockFactory()

SampleBlockFactory::~SampleBlockFactory ( )
virtualdefault

Member Function Documentation

◆ Create()

SampleBlockPtr SampleBlockFactory::Create ( constSamplePtr  src,
size_t  numsamples,
sampleFormat  srcformat 
)

Definition at line 26 of file SampleBlock.cpp.

29{
30 auto result = DoCreate(src, numsamples, srcformat);
31 if (!result)
33 return result;
34}
#define THROW_INCONSISTENCY_EXCEPTION
Throw InconsistencyException, using C++ preprocessor to identify the source code location.
virtual SampleBlockPtr DoCreate(constSamplePtr src, size_t numsamples, sampleFormat srcformat)=0

References DoCreate(), and THROW_INCONSISTENCY_EXCEPTION.

Referenced by anonymous_namespace{Sequence.cpp}::ShareOrCopySampleBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateFromXML()

SampleBlockPtr SampleBlockFactory::CreateFromXML ( sampleFormat  srcformat,
const AttributesList attrs 
)

Definition at line 46 of file SampleBlock.cpp.

49{
50 auto result = DoCreateFromXML(srcformat, attrs);
51 if (!result)
53 return result;
54}
virtual SampleBlockPtr DoCreateFromXML(sampleFormat srcformat, const AttributesList &attrs)=0

References DoCreateFromXML(), and THROW_INCONSISTENCY_EXCEPTION.

Here is the call graph for this function:

◆ CreateSilent()

SampleBlockPtr SampleBlockFactory::CreateSilent ( size_t  numsamples,
sampleFormat  srcformat 
)

Definition at line 36 of file SampleBlock.cpp.

39{
40 auto result = DoCreateSilent(numsamples, srcformat);
41 if (!result)
43 return result;
44}
virtual SampleBlockPtr DoCreateSilent(size_t numsamples, sampleFormat srcformat)=0

References DoCreateSilent(), and THROW_INCONSISTENCY_EXCEPTION.

Here is the call graph for this function:

◆ DoCreate()

virtual SampleBlockPtr SampleBlockFactory::DoCreate ( constSamplePtr  src,
size_t  numsamples,
sampleFormat  srcformat 
)
protectedpure virtual

Implemented in SqliteSampleBlockFactory.

Referenced by Create().

Here is the caller graph for this function:

◆ DoCreateFromXML()

virtual SampleBlockPtr SampleBlockFactory::DoCreateFromXML ( sampleFormat  srcformat,
const AttributesList attrs 
)
protectedpure virtual

Implemented in SqliteSampleBlockFactory.

Referenced by CreateFromXML().

Here is the caller graph for this function:

◆ DoCreateSilent()

virtual SampleBlockPtr SampleBlockFactory::DoCreateSilent ( size_t  numsamples,
sampleFormat  srcformat 
)
protectedpure virtual

Implemented in SqliteSampleBlockFactory.

Referenced by CreateSilent().

Here is the caller graph for this function:

◆ GetActiveBlockIDs()

virtual SampleBlockIDs SampleBlockFactory::GetActiveBlockIDs ( )
pure virtual
Returns
ids of all sample blocks created by this factory and still extant

Implemented in SqliteSampleBlockFactory.

◆ New()

SampleBlockFactoryPtr SampleBlockFactory::New ( AudacityProject project)
static

Definition at line 16 of file SampleBlock.cpp.

17{
18 auto &factory = Factory::Get();
19 if ( ! factory )
21 return factory( project );
22}
static RegisteredToolbarFactory factory

References factory, GlobalVariable< Factory, const std::function< SampleBlockFactoryPtr(AudacityProject &) >, Options... >::Get(), and THROW_INCONSISTENCY_EXCEPTION.

Referenced by BenchmarkDialog::OnRun().

Here is the call graph for this function:
Here is the caller graph for this function:

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