LMMS
Loading...
Searching...
No Matches
zyncarla::EffectMgr Class Reference

#include <EffectMgr.h>

Inheritance diagram for zyncarla::EffectMgr:
zyncarla::Presets

Public Member Functions

 EffectMgr (Allocator &alloc, const SYNTH_T &synth, const bool insertion_, const AbsTime *time_=nullptr)
 ~EffectMgr ()
void paste (EffectMgr &e)
void add2XML (XMLwrapper &xml)
void defaults (void) REALTIME
void getfromXML (XMLwrapper &xml)
void out (float *smpsl, float *smpsr) REALTIME
void setdryonly (bool value)
float sysefxgetvolume (void)
void init (void) REALTIME
void kill (void) REALTIME
void cleanup (void) REALTIME
void changeeffectrt (int nefx_, bool avoidSmash=false) REALTIME
void changeeffect (int nefx_) NONREALTIME
int geteffect (void)
void changepreset (unsigned char npreset) NONREALTIME
void changepresetrt (unsigned char npreset, bool avoidSmash=false) REALTIME
unsigned char getpreset (void)
void seteffectpar (int npar, unsigned char value) NONREALTIME
void seteffectparrt (int npar, unsigned char value) REALTIME
unsigned char geteffectpar (int npar)
unsigned char geteffectparrt (int npar) REALTIME
float getEQfreqresponse (float freq)
Public Member Functions inherited from zyncarla::Presets
 Presets ()
virtual ~Presets ()
virtual void copy (PresetsStore &ps, const char *name)
virtual bool checkclipboardtype (PresetsStore &ps)
void deletepreset (PresetsStore &ps, int npreset)

Public Attributes

const bool insertion
float * efxoutl
float * efxoutr
FilterParamsfilterpars
int nefx
Effectefx
const AbsTimetime
Public Attributes inherited from zyncarla::Presets
char type [MAX_PRESETTYPE_SIZE]

Static Public Attributes

static const rtosc::Portsports = local_ports

Private Attributes

char preset
char settings [128]
bool dryonly
Allocatormemory
const SYNTH_Tsynth

Additional Inherited Members

Protected Member Functions inherited from zyncarla::Presets
void setpresettype (const char *type)

Detailed Description

Effect manager, an interface between the program and effects

Constructor & Destructor Documentation

◆ EffectMgr()

EffectMgr::EffectMgr ( Allocator & alloc,
const SYNTH_T & synth,
const bool insertion_,
const AbsTime * time_ = nullptr )

◆ ~EffectMgr()

EffectMgr::~EffectMgr ( )

Member Function Documentation

◆ add2XML()

void EffectMgr::add2XML ( XMLwrapper & xml)
virtual

Implements zyncarla::Presets.

◆ changeeffect()

void EffectMgr::changeeffect ( int nefx_)

◆ changeeffectrt()

void EffectMgr::changeeffectrt ( int nefx_,
bool avoidSmash = false )

◆ changepreset()

void EffectMgr::changepreset ( unsigned char npreset)

◆ changepresetrt()

void EffectMgr::changepresetrt ( unsigned char npreset,
bool avoidSmash = false )

◆ cleanup()

void EffectMgr::cleanup ( void )

◆ defaults()

void EffectMgr::defaults ( void )

◆ geteffect()

int EffectMgr::geteffect ( void )

◆ geteffectpar()

unsigned char EffectMgr::geteffectpar ( int npar)

◆ geteffectparrt()

unsigned char EffectMgr::geteffectparrt ( int npar)

◆ getEQfreqresponse()

float EffectMgr::getEQfreqresponse ( float freq)

◆ getfromXML()

void EffectMgr::getfromXML ( XMLwrapper & xml)

◆ getpreset()

unsigned char EffectMgr::getpreset ( void )

◆ init()

void EffectMgr::init ( void )

◆ kill()

void EffectMgr::kill ( void )

◆ out()

void EffectMgr::out ( float * smpsl,
float * smpsr )

◆ paste()

void EffectMgr::paste ( EffectMgr & e)

◆ setdryonly()

void EffectMgr::setdryonly ( bool value)

◆ seteffectpar()

void EffectMgr::seteffectpar ( int npar,
unsigned char value )

◆ seteffectparrt()

void EffectMgr::seteffectparrt ( int npar,
unsigned char value )

◆ sysefxgetvolume()

float EffectMgr::sysefxgetvolume ( void )

get the output(to speakers) volume of the systemeffect

Member Data Documentation

◆ dryonly

bool zyncarla::EffectMgr::dryonly
private

◆ efx

Effect* zyncarla::EffectMgr::efx

◆ efxoutl

float* zyncarla::EffectMgr::efxoutl

◆ efxoutr

float * zyncarla::EffectMgr::efxoutr

◆ filterpars

FilterParams* zyncarla::EffectMgr::filterpars

◆ insertion

const bool zyncarla::EffectMgr::insertion

◆ memory

Allocator& zyncarla::EffectMgr::memory
private

◆ nefx

int zyncarla::EffectMgr::nefx

◆ ports

const rtosc::Ports & EffectMgr::ports = local_ports
static

◆ preset

char zyncarla::EffectMgr::preset
private

◆ settings

char zyncarla::EffectMgr::settings[128]
private

When loading an effect from XML the child effect cannot be loaded directly as it would require access to the realtime memory pool, which cannot be done outside of the realtime thread. Therefore, parameters are loaded to this array which can then be used to construct the full effect (via init()) once the object is in the realtime context.

Additionally this structure is used in the case of pasting effects as pasted effect object are not fully initialized when they're put on the middleware -> backend ringbuffer, but settings has the values loaded from the XML serialization. The settings values can be pasted once they're on the realtime thread and then they can be applied.

The requirement that the realtime memory pool is used to create the effect is in place as it is possible to change the effect type in the realtime thread and thus the new effect would draw from the realtime memory pool and the old object would be expected to be freed to the realtime memory pool.

See also: PresetExtractor.cpp

◆ synth

const SYNTH_T& zyncarla::EffectMgr::synth
private

◆ time

const AbsTime* zyncarla::EffectMgr::time

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