9#ifndef __AUDACITY_SAMPLE_BLOCK__
10#define __AUDACITY_SAMPLE_BLOCK__
18#include <unordered_set>
60 size_t numsamples,
bool mayThrow = true);
66 virtual
size_t GetSampleCount() const = 0;
70 GetSummary256(
float *dest,
size_t frameoffset,
size_t numframes) = 0;
73 GetSummary64k(
float *dest,
size_t frameoffset,
size_t numframes) = 0;
79 size_t start,
size_t len,
bool mayThrow = true);
84 MinMaxRMS GetMinMaxRMS(
bool mayThrow = true) const;
86 virtual
size_t GetSpaceUsage() const = 0;
94 size_t numsamples) = 0;
96 virtual
MinMaxRMS DoGetMinMaxRMS(
size_t start,
size_t len) = 0;
106 total += pBlock->GetSpaceUsage();
119 SampleBlockFactoryPtr( AudacityProject& )
An audio segment is either a whole clip or the silence between clips. Views allow shared references t...
std::shared_ptr< std::vector< float > > BlockSampleView
std::shared_ptr< SampleBlock > SampleBlockPtr
std::function< void(SampleBlockConstPtr) > BlockSpaceUsageAccumulator(unsigned long long &total)
std::shared_ptr< const SampleBlock > SampleBlockConstPtr
std::shared_ptr< SampleBlockFactory > SampleBlockFactoryPtr
std::vector< Attribute > AttributesList
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Global function-valued variable, adding a convenient Call()
An object that sends messages to an open-ended list of subscribed callbacks.
Object associated with a project that manages reading and writing of Audacity project file formats,...
abstract base class with methods to produce SampleBlock objects
std::unordered_set< SampleBlockID > SampleBlockIDs
virtual SampleBlockPtr DoCreateFromXML(sampleFormat srcformat, const AttributesList &attrs)=0
virtual SampleBlockIDs GetActiveBlockIDs()=0
virtual ~SampleBlockFactory()
virtual SampleBlockPtr DoCreateSilent(size_t numsamples, sampleFormat srcformat)=0
virtual SampleBlockPtr DoCreate(constSamplePtr src, size_t numsamples, sampleFormat srcformat)=0
virtual SampleBlockPtr DoCreateFromId(sampleFormat srcformat, SampleBlockID id)=0
Abstract class allows access to contents of a block of sound samples, serialization as XML,...
virtual void CloseLock() noexcept=0
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Global factory of per-project factories of sample blocks.