arcsdec::v_1_0_0::SampleProvider class

Inteface for providers of sample sequences.

A SampleProvider is a source for sample sequences and updated AudioSize values. It can signal different events while processing the audio input. A SampleProcessor can be attached to it as an addressee of those events.

Derived classes

class v_1_0_0::AudioReaderImpl
Abstract base class for AudioReader implementations.

Constructors, destructors, conversion operators

SampleProvider()
Constructor.
~SampleProvider() virtual noexcept
Virtual default destructor.

Public functions

void attach_processor(SampleProcessor& processor)
Attach a SampleProcessor.
auto processor() const -> const SampleProcessor*
Return the registered SampleProcessor.
void signal_appendsamples(SampleInputIterator begin, SampleInputIterator end)
Signal the processor to append the following range of samples.
void signal_endinput()
Signal the processor that input ends.
void signal_startinput()
Signal the processor that input starts.
void signal_updateaudiosize(const AudioSize& size)
Signal the processor to update the audio size.

Private functions

void do_attach_processor(SampleProcessor& processor) pure virtual
Register a SampleProcessor.
auto do_processor() const -> const SampleProcessor* pure virtual
Return the registered SampleProcessor.
void do_signal_appendsamples(SampleInputIterator begin, SampleInputIterator end) pure virtual
Implements signal_appendsamples().
void do_signal_endinput() pure virtual
Implements signal_endinput().
void do_signal_startinput() pure virtual
Implements signal_startinput().
void do_signal_updateaudiosize(const AudioSize& size) pure virtual
Signal the processor to update the audio size.

Function documentation

void arcsdec::v_1_0_0::SampleProvider::attach_processor(SampleProcessor& processor)

Attach a SampleProcessor.

Parameters
processor in The SampleProcessor to use

const SampleProcessor* arcsdec::v_1_0_0::SampleProvider::processor() const

Return the registered SampleProcessor.

Returns The SampleProcessor the reader uses

void arcsdec::v_1_0_0::SampleProvider::signal_appendsamples(SampleInputIterator begin, SampleInputIterator end)

Signal the processor to append the following range of samples.

Parameters
begin in Start of the sample sequence
end in End of the sample sequence

void arcsdec::v_1_0_0::SampleProvider::signal_updateaudiosize(const AudioSize& size)

Signal the processor to update the audio size.

Parameters
size in The updated value to signal

void arcsdec::v_1_0_0::SampleProvider::do_attach_processor(SampleProcessor& processor) pure virtual private

Register a SampleProcessor.

Parameters
processor in The SampleProcessor to use

This will register all callback methods of the processor. Already registered callbacks will be overwritten by this method.

The method is a mere convenience for completely registering a single SampleProcessor instance.

const SampleProcessor* arcsdec::v_1_0_0::SampleProvider::do_processor() const pure virtual private

Return the registered SampleProcessor.

Returns The SampleProcessor the reader uses

void arcsdec::v_1_0_0::SampleProvider::do_signal_appendsamples(SampleInputIterator begin, SampleInputIterator end) pure virtual private

Implements signal_appendsamples().

Parameters
begin in Start of the sample sequence
end in End of the sample sequence

void arcsdec::v_1_0_0::SampleProvider::do_signal_updateaudiosize(const AudioSize& size) pure virtual private

Signal the processor to update the audio size.

Parameters
size in The updated value to signal