27 lines
No EOL
715 B
C++
27 lines
No EOL
715 B
C++
#ifndef MIXER_HPP_INCLUDED
|
|
#define MIXER_HPP_INCLUDED
|
|
|
|
#include <cstdint>
|
|
|
|
template <uint32_t NumInputs> class Mixer {
|
|
public:
|
|
Mixer(float initGain);
|
|
|
|
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(uint32_t index) const;
|
|
float gains_[NumInputs];
|
|
bool normalise_;
|
|
};
|
|
|
|
#endif // MIXER_HPP_INCLUDED
|