Gin
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
AudioFunctionHost Class Reference

State management for audio functions in AudioEquationParser. More...

#include <gin_audiofunctions.h>

Inheritance diagram for AudioFunctionHost:

Public Member Functions

void setSampleRate (double sr)
 
double getSampleRate ()
 
void reset ()
 
void addConstants (gin::EquationParser &)
 
void addUtilities (gin::EquationParser &)
 
void addOscillatorFunctions (gin::EquationParser &)
 
void addSynthFilterFunctions (gin::EquationParser &)
 
void addEffectFilterFunctions (gin::EquationParser &)
 
template<class T >
T * getFuncParams (int i, double sr)
 

Public Attributes

gin::BandLimitedLookupTables * lookupTables = nullptr
 

Protected Attributes

std::map< int, std::unique_ptr< FuncState > > funcStates
 
double sampleRate = 44100.0
 

Detailed Description

State management for audio functions in AudioEquationParser.

AudioFunctionHost manages the state objects for all stateful audio functions (filters, oscillators, noise generators) used in audio equation parsing. It provides factory methods for creating and retrieving state objects, ensuring each function instance maintains its own state across evaluations.

Key Features:

The host maintains a map of state objects, creating them on-demand when functions are first called and reusing them for subsequent calls to maintain continuity (e.g., filter history, oscillator phase).

See also
FuncState, AudioEquationParser, EquationParser

Member Function Documentation

◆ setSampleRate()

void AudioFunctionHost::setSampleRate ( double  sr)

◆ getSampleRate()

double AudioFunctionHost::getSampleRate ( )

References sampleRate.

◆ reset()

void AudioFunctionHost::reset ( )

◆ addConstants()

void AudioFunctionHost::addConstants ( gin::EquationParser &  )

◆ addUtilities()

void AudioFunctionHost::addUtilities ( gin::EquationParser &  )

◆ addOscillatorFunctions()

void AudioFunctionHost::addOscillatorFunctions ( gin::EquationParser &  )

◆ addSynthFilterFunctions()

void AudioFunctionHost::addSynthFilterFunctions ( gin::EquationParser &  )

◆ addEffectFilterFunctions()

void AudioFunctionHost::addEffectFilterFunctions ( gin::EquationParser &  )

◆ getFuncParams()

template<class T >
T * AudioFunctionHost::getFuncParams ( int  i,
double  sr 
)

References funcStates.

Member Data Documentation

◆ lookupTables

gin::BandLimitedLookupTables* AudioFunctionHost::lookupTables = nullptr

◆ funcStates

std::map<int, std::unique_ptr<FuncState> > AudioFunctionHost::funcStates
protected

Referenced by getFuncParams().

◆ sampleRate

double AudioFunctionHost::sampleRate = 44100.0
protected

Referenced by getSampleRate().


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