arcsdec::v_1_0_0::AudioReaderImpl class

Abstract base class for AudioReader implementations.

Concrete subclasses of AudioReaderImpl implement AudioReaders for a concrete FileReaderDescriptor.

Base classes

class v_1_0_0::SampleProvider
Inteface for providers of sample sequences.

Constructors, destructors, conversion operators

AudioReaderImpl()
Default constructor.

Public functions

auto acquire_size(const std::string& filename) -> std::unique_ptr<AudioSize>
Provides implementation for acquire_size() of a AudioReader.
auto descriptor() const -> std::unique_ptr<FileReaderDescriptor>
Create a descriptor for this AudioReader implementation.
void process_file(const std::string& filename)
Provides implementation for process_file() of some AudioReader.
auto samples_per_read() const -> int64_t
Return the number of samples to read in one read operation.
void set_samples_per_read(const int64_t samples_per_read)
Set the number of samples to read in one read operation.

Protected functions

void attach_processor_impl(SampleProcessor& processor)
Default implementation of attach_processor().
auto to_audiosize(const int64_t total_samples, const UNIT& u) const -> AudioSize
Service: convert 64 bit wide number of total samples to AudioSize.
auto use_processor() -> SampleProcessor*
Use the internal SampleProcessor.

Private functions

auto do_acquire_size(const std::string& filename) -> std::unique_ptr<AudioSize> pure virtual
Provides implementation for acquire_size() of an AudioReader.
void do_process_file(const std::string& filename) pure virtual
Provides implementation for process_file() of some AudioReader.

Function documentation

std::unique_ptr<AudioSize> arcsdec::v_1_0_0::AudioReaderImpl::acquire_size(const std::string& filename)

Provides implementation for acquire_size() of a AudioReader.

Parameters
filename in The filename of the file to process
Returns A CalcContext for the specified file
Exceptions
FileReadException If the file could not be read

std::unique_ptr<FileReaderDescriptor> arcsdec::v_1_0_0::AudioReaderImpl::descriptor() const

Create a descriptor for this AudioReader implementation.

Returns Descriptor for this implementation.

void arcsdec::v_1_0_0::AudioReaderImpl::process_file(const std::string& filename)

Provides implementation for process_file() of some AudioReader.

Parameters
filename in The filename of the file to process
Returns The checksums of this file
Exceptions
FileReadException If the file could not be read

int64_t arcsdec::v_1_0_0::AudioReaderImpl::samples_per_read() const

Return the number of samples to read in one read operation.

Returns Number of samples per read operation.

void arcsdec::v_1_0_0::AudioReaderImpl::set_samples_per_read(const int64_t samples_per_read)

Set the number of samples to read in one read operation.

Parameters
samples_per_read in Number of samples to read/buffer at once.

The default is BLOCKSIZE::DEFAULT.

AudioSize arcsdec::v_1_0_0::AudioReaderImpl::to_audiosize(const int64_t total_samples, const UNIT& u) const protected

Service: convert 64 bit wide number of total samples to AudioSize.

Parameters
total_samples in Total samples
u
Returns AudioSize representing the number of total samples
Exceptions
std::invalid_argument If total_samples is bigger than 32 bit

std::unique_ptr<AudioSize> arcsdec::v_1_0_0::AudioReaderImpl::do_acquire_size(const std::string& filename) pure virtual private

Provides implementation for acquire_size() of an AudioReader.

Parameters
filename in The filename of the file to process
Returns A CalcContext for the specified file
Exceptions
FileReadException If the file could not be read

void arcsdec::v_1_0_0::AudioReaderImpl::do_process_file(const std::string& filename) pure virtual private

Provides implementation for process_file() of some AudioReader.

Parameters
filename in The filename of the file to process
Returns The checksums of this file
Exceptions
FileReadException If the file could not be read