3#include "dsp/hart_dsp.hpp"
12template <
typename SampleType>
14 public DSP<SampleType,
Flip<SampleType>>
17 void prepare (
double , size_t , size_t , size_t )
override
21 void process (
const AudioBuffer<SampleType>& input, AudioBuffer<SampleType>& output,
const EnvelopeBuffers& ,
ChannelFlags channelsToProcess)
override
23 hassert (input.getNumChannels() == output.getNumChannels());
24 hassert (input.getNumFrames() == output.getNumFrames());
26 const size_t numChannels = input.getNumChannels();
27 const size_t numFrames = input.getNumFrames();
29 for (size_t channel = 0; channel < numChannels; ++channel)
31 const SampleType* inputData = input[channel];
32 SampleType* outputData = output[channel];
34 if (channelsToProcess
[channel
] ==
true)
37 for (size_t frame = 0; frame < numFrames; ++frame)
38 outputData[frame] = -inputData[frame];
43 for (size_t frame = 0; frame < numFrames; ++frame)
44 outputData[frame] = inputData[frame];
57 return numInputChannels == numOutputChannels;
A set of boolean flags mapped to each audio channel.
std::bitset< m_maxChannels >::reference operator[](size_t channel)
Access the flag value for a specific channel.
void setValue(int, double)
Sets DSP value.
void process(const AudioBuffer< SampleType > &input, AudioBuffer< SampleType > &output, const EnvelopeBuffers &, ChannelFlags channelsToProcess) override
Processes the audio.
void prepare(double, size_t, size_t, size_t) override
Prepare for processing.
bool supportsChannelLayout(size_t numInputChannels, size_t numOutputChannels) const
Tells the runner (host) whether this effect supports a specific i/o configuration.
#define HART_DSP_COPYABLE(ClassName)
Implements a generic hart::DSP::copy() method.
#define HART_DSP_MOVABLE(ClassName)
Implements a generic hart::DSP::move() method.
#define hassert(condition)
Triggers a HartAssertException if the condition is false
#define hassertfalse
Triggers a HartAssertException
#define HART_DEFINE_GENERIC_REPRESENT(ClassName)
Defines a basic string representation of your class.
#define HART_DSP_DECLARE_ALIASES_FOR(ClassName)