VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
vae_effects_processor.hpp
Go to the documentation of this file.
1#ifndef _VAE_EFFECTS_PROCESSOR
2#define _VAE_EFFECTS_PROCESSOR
3
4#include "../pod/vae_effect.hpp"
5#include "../pod/vae_mixer.hpp"
6#include "../dsp/vae_effect_base.hpp"
7#include "../vae_util.hpp"
8
9namespace vae { namespace core {
12 public:
13 void init() {
15 }
16 void mix(Effect& effect, ScratchBuffer& buffer) {
17 if (effect.effect == nullptr || effect.bypassed) { return; }
18 VAE_PROFILER_SCOPE_NAMED("Process Effect")
19 mScratchBuffer.set(buffer);
21 VAE_ASSERT(effect.effect->getNumInputs() == effect.effect->getNumOutputs())
22 VAE_ASSERT(buffer.channels() <= effect.effect->getNumInputs())
23 effect.effect->process(effect, mScratchBuffer, buffer);
24 }
25 }; // EffectsProcessor
26} } // vae::core
27
28#endif // _VAE_EFFECTS_PROCESSOR
bool resize(const Size length, uchar channels)
! Will not keep the contents! Resizes the buffer to the desired length and channel count.
uchar channels() const
Returns the amount of channels.
Size validSize() const
Returns the length of actually valid audio in the buffer.
void setValidSize(const Size v)
Set the amount of valid samples currently in the buffer This is mostly a convenience flag since the a...
void set(const T2 *samples, Size length, const uchar channel=0, const Size offsetDst=0)
Set a single channel from an array.
void mix(Effect &effect, ScratchBuffer &buffer)
virtual void process(Effect &effect, const ScratchBuffer &in, ScratchBuffer &out)=0
constexpr Size MaxBlock
Maximum block size.
Definition: vae.hpp:276
constexpr unsigned char MaxChannels
Maximum channel count used to pre allocate buffers.
Definition: vae.hpp:268
Contains Typedefinitions and basic structures use by the public API and internally.
Definition: vae.hpp:31
Effect pod.
Definition: vae_effect.hpp:12
effect::EffectBase * effect
References the DSP.
Definition: vae_effect.hpp:21
#define VAE_PROFILER_SCOPE_NAMED(name)
Profiles a scope and names it.
#define VAE_ASSERT(condition)
Definition: vae_util.hpp:11