Audaspace 1.4.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Accumulator Class Reference

This sound creates an accumulator reader. More...

#include <Accumulator.h>

Inheritance diagram for Accumulator:
Inheritance graph
[legend]

Public Member Functions

 Accumulator (std::shared_ptr< ISound > sound, bool additive=false)
 Creates a new accumulator sound.
 
virtual std::shared_ptr< IReadercreateReader ()
 Creates a reader for playback of the sound source.
 
- Public Member Functions inherited from Effect
 Effect (std::shared_ptr< ISound > sound)
 Creates a new sound.
 
virtual ~Effect ()
 Destroys the sound.
 
std::shared_ptr< ISoundgetSound () const
 Returns the saved sound.
 
- Public Member Functions inherited from ISound
virtual ~ISound ()
 Destroys the sound.
 
virtual std::shared_ptr< IReadercreateReader ()=0
 Creates a reader for playback of the sound source.
 

Static Public Member Functions

static sample_t AUD_LOCAL accumulatorFilterAdditive (CallbackIIRFilterReader *reader, void *useless)
 The accumulatorFilterAdditive function implements the doFilterIIR callback for the additive accumulator filter.
 
static sample_t AUD_LOCAL accumulatorFilter (CallbackIIRFilterReader *reader, void *useless)
 The accumulatorFilter function implements the doFilterIIR callback for the non-additive accumulator filter.
 

Additional Inherited Members

- Protected Member Functions inherited from Effect
std::shared_ptr< IReadergetReader () const
 Returns the reader created out of the sound.
 
- Protected Attributes inherited from Effect
std::shared_ptr< ISoundm_sound
 If there is no reader it is created out of this sound.
 

Detailed Description

This sound creates an accumulator reader.

The accumulator adds the difference at the input to the last output in case it's positive. In additive mode it additionaly adds the difference always. So in case the difference is positive, it's added twice.

Constructor & Destructor Documentation

◆ Accumulator()

Accumulator::Accumulator ( std::shared_ptr< ISound sound,
bool  additive = false 
)

Creates a new accumulator sound.

Parameters
soundThe input sound.
additiveWhether the accumulator is additive.

Member Function Documentation

◆ accumulatorFilter()

static sample_t AUD_LOCAL Accumulator::accumulatorFilter ( CallbackIIRFilterReader reader,
void *  useless 
)
static

The accumulatorFilter function implements the doFilterIIR callback for the non-additive accumulator filter.

Parameters
readerThe CallbackIIRFilterReader that executes the callback.
uselessA user defined pointer that is not needed for this filter.
Returns
The filtered sample.

◆ accumulatorFilterAdditive()

static sample_t AUD_LOCAL Accumulator::accumulatorFilterAdditive ( CallbackIIRFilterReader reader,
void *  useless 
)
static

The accumulatorFilterAdditive function implements the doFilterIIR callback for the additive accumulator filter.

Parameters
readerThe CallbackIIRFilterReader that executes the callback.
uselessA user defined pointer that is not needed for this filter.
Returns
The filtered sample.

◆ createReader()

virtual std::shared_ptr< IReader > Accumulator::createReader ( )
virtual

Creates a reader for playback of the sound source.

Returns
A pointer to an IReader object or nullptr if there has been an error.
Exceptions
ExceptionAn exception may be thrown if there has been a more unexpected error during reader creation.

Implements ISound.


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