AudioReaderImpl class
#include <audioreader.hpp>
Abstract base class for AudioReader implementations.
Concrete subclasses of AudioReaderImpl implement AudioReaders for a concrete FileReaderDescriptor.
Base classes
- class v_1_0_0::SampleProvider
- Interface 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_of an AudioReader.size() - 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:: AudioReaderImpl:: acquire_size(const std::string& filename)
Provides implementation for acquire_
| 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:: AudioReaderImpl:: descriptor() const
Create a descriptor for this AudioReader implementation.
| Returns | Descriptor for this implementation. |
|---|
void arcsdec:: AudioReaderImpl:: process_file(const std::string& filename)
Provides implementation for process_
| Parameters | |
|---|---|
| filename in | The filename of the file to process |
| Exceptions | |
| FileReadException | If the file could not be read |
int64_t arcsdec:: 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:: 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::
void arcsdec:: AudioReaderImpl:: attach_processor_impl(SampleProcessor& processor) protected
Default implementation of attach_
| Parameters | |
|---|---|
| processor in | The processor to attach |
AudioSize arcsdec:: 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 in | Unit of total_samples |
| Returns | AudioSize representing the number of total samples |
| Exceptions | |
| std::invalid_argument | If total_samples is bigger than 32 bit |
SampleProcessor* arcsdec:: AudioReaderImpl:: use_processor() protected
Use the internal SampleProcessor.
| Returns | Use the internal SampleProcessor |
|---|
std::unique_ptr<AudioSize> arcsdec:: AudioReaderImpl:: do_acquire_size(const std::string& filename) pure virtual private
Provides implementation for acquire_ 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:: AudioReaderImpl:: do_process_file(const std::string& filename) pure virtual private
Provides implementation for process_
| Parameters | |
|---|---|
| filename in | The filename of the file to process |
| Exceptions | |
| FileReadException | If the file could not be read |