feat: added mixer component and add wet/dry mix to distortion
This commit is contained in:
parent
9acddeb29c
commit
c6f8cb1e0e
4 changed files with 122 additions and 4 deletions
29
core/Mixer.hpp
Normal file
29
core/Mixer.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef MIXER_HPP_INCLUDED
|
||||
#define MIXER_HPP_INCLUDED
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
template <uint32_t NumInputs> class Mixer {
|
||||
public:
|
||||
Mixer(float init_gain);
|
||||
|
||||
void process(const float **inputs, float *out, uint32_t frames);
|
||||
void processStereo(const float **inputsL, const float **inputsR, float *outL,
|
||||
float *outR, uint32_t frames);
|
||||
|
||||
void setInputGain(uint32_t index, float gain);
|
||||
float getInputGain(uint32_t index) const;
|
||||
|
||||
void setNormalise(bool norm);
|
||||
bool getNormalise() const;
|
||||
|
||||
private:
|
||||
void mixChannels(const float **inputs, float *out, uint32_t frames);
|
||||
bool isValidInputIndex(float index) const;
|
||||
float gains_[NumInputs];
|
||||
bool normalise_;
|
||||
};
|
||||
|
||||
#endif // MIXER_HPP_INCLUDED
|
||||
|
||||
template class Mixer<2u>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue