AudioEffect
Base for every DSP node we put on a bus. Owns one ma_node*-shaped object — derived classes pick which ma_*_node they wrap and how to interpret their config. Lifetime: created via the AudioEngine::CreateXxxEffect factories (which need engine init), destroyed by ~AudioEffect after the engine has detached the node from the graph.
- Module
- Audio
- Header
#include "Audio/AudioEffect.h"- Namespace
Mowo
Threading: parameter mutators (e.g. SetCutoff) run on the game thread but the reinit they need is not safe against the audio thread reading the same coefficients. So a mutator only *publishes* the new values; the audio thread applies them between blocks, from the engine's process callback. Bypass uses ma_node_set_state, which is lock-safe and needs none of this.
Constructors
| Signature | Name | Description |
|---|---|---|
explicit AudioEffect(AudioEffectType type) | AudioEffect | |
virtual ~AudioEffect() | ~AudioEffect | |
AudioEffect(const AudioEffect&) = delete | AudioEffect |
Public functions
| Returns | Name | Description |
|---|---|---|
AudioEffect& | operator= | |
AudioEffectType | GetType | |
ma_node* | GetNode | Underlying ma_node — used by AudioEngine to wire the effect into the bus chain. |
bool | IsBypassed | Bypass via node state. |
void | SetBypassed | |
void | DrainPendingParams | Audio thread only: applies whatever the game thread last published. |
Function details
AudioEffect
explicit AudioEffect(AudioEffectType type)~AudioEffect
virtual ~AudioEffect()AudioEffect
AudioEffect(const AudioEffect&) = deleteoperator=
AudioEffect& operator=(const AudioEffect&) = deleteGetType
AudioEffectType GetType() constGetNode
virtual ma_node* GetNode() = 0Underlying ma_node — used by AudioEngine to wire the effect into the bus chain. nullptr until the concrete subclass's Init() has run.
IsBypassed
bool IsBypassed() constBypass via node state. When stopped, miniaudio passes input through to output unmodified (zero cost). Lock-safe — can be flipped from anywhere.
SetBypassed
void SetBypassed(bool bypass)DrainPendingParams
void DrainPendingParams()Audio thread only: applies whatever the game thread last published. Cheap when nothing changed — one relaxed load.