2026-08-04 03:33:53 +01:00
|
|
|
#ifndef MIXER_HPP_INCLUDED
|
|
|
|
|
#define MIXER_HPP_INCLUDED
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
template <uint32_t NumInputs> class Mixer {
|
|
|
|
|
public:
|
2026-08-05 13:46:38 +01:00
|
|
|
Mixer(float initGain);
|
2026-08-04 03:33:53 +01:00
|
|
|
|
|
|
|
|
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);
|
2026-08-05 17:43:54 +01:00
|
|
|
bool isValidInputIndex(uint32_t index) const;
|
2026-08-04 03:33:53 +01:00
|
|
|
float gains_[NumInputs];
|
|
|
|
|
bool normalise_;
|
|
|
|
|
};
|
|
|
|
|
|
2026-08-05 17:43:54 +01:00
|
|
|
#endif // MIXER_HPP_INCLUDED
|