Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
BaseIIRFilterReader Class Referenceabstract

This class is a base class for infinite impulse response filters. More...

#include <BaseIIRFilterReader.h>

Inheritance diagram for BaseIIRFilterReader:
Inheritance graph
[legend]

Public Member Functions

sample_t x (int pos)
 Retrieves the last input samples.
 
sample_t y (int pos)
 Retrieves the last output samples.
 
virtual void read (int &length, bool &eos, sample_t *buffer)
 Request to read the next length samples out of the source.
 
virtual sample_t filter ()=0
 Runs the filtering function.
 
virtual void sampleRateChanged (SampleRate rate)
 Notifies the filter about a sample rate change.
 
- Public Member Functions inherited from EffectReader
 EffectReader (std::shared_ptr< IReader > reader)
 Creates a new effect reader.
 
virtual ~EffectReader ()
 Destroys the reader.
 
virtual bool isSeekable () const
 Tells whether the source provides seeking functionality or not.
 
virtual void seek (int position)
 Seeks to a specific position in the source.
 
virtual int getLength () const
 Returns an approximated length of the source in samples.
 
virtual int getPosition () const
 Returns the position of the source as a sample count value.
 
virtual Specs getSpecs () const
 Returns the specification of the reader.
 
- Public Member Functions inherited from IReader
virtual ~IReader ()
 Destroys the reader.
 

Protected Member Functions

 BaseIIRFilterReader (std::shared_ptr< IReader > reader, int in, int out)
 Creates a new base IIR filter reader.
 
void setLengths (int in, int out)
 Sets the length for the required input and output samples of the IIR filter.
 

Additional Inherited Members

- Protected Attributes inherited from EffectReader
std::shared_ptr< IReaderm_reader
 The reader to read from.
 

Detailed Description

This class is a base class for infinite impulse response filters.

Constructor & Destructor Documentation

◆ BaseIIRFilterReader()

BaseIIRFilterReader::BaseIIRFilterReader ( std::shared_ptr< IReader > reader,
int in,
int out )
protected

Creates a new base IIR filter reader.

Parameters
readerThe reader to read from.
inThe count of past input samples needed.
outThe count of past output samples needed.

Member Function Documentation

◆ filter()

virtual sample_t BaseIIRFilterReader::filter ( )
pure virtual

Runs the filtering function.

Returns
The current output sample value.

Implemented in CallbackIIRFilterReader, and IIRFilterReader.

◆ read()

virtual void BaseIIRFilterReader::read ( int & length,
bool & eos,
sample_t * buffer )
virtual

Request to read the next length samples out of the source.

The buffer supplied has the needed size.

Parameters
[in,out]lengthThe count of samples that should be read. Shall contain the real count of samples after reading, in case there were only fewer samples available. A smaller value also indicates the end of the reader.
[out]eosEnd of stream, whether the end is reached or not.
[in]bufferThe pointer to the buffer to read into.

Reimplemented from EffectReader.

◆ sampleRateChanged()

virtual void BaseIIRFilterReader::sampleRateChanged ( SampleRate rate)
virtual

Notifies the filter about a sample rate change.

Parameters
rateThe new sample rate.

Reimplemented in DynamicIIRFilterReader.

◆ setLengths()

void BaseIIRFilterReader::setLengths ( int in,
int out )
protected

Sets the length for the required input and output samples of the IIR filter.

Parameters
inThe amount of past input samples needed, including the current one.
outThe amount of past output samples needed.

◆ x()

sample_t BaseIIRFilterReader::x ( int pos)
inline

Retrieves the last input samples.

Parameters
posThe position, valid are 0 (current) or negative values.
Returns
The sample value.

◆ y()

sample_t BaseIIRFilterReader::y ( int pos)
inline

Retrieves the last output samples.

Parameters
posThe position, valid are negative values.
Returns
The sample value.

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