33 lines
No EOL
782 B
C++
33 lines
No EOL
782 B
C++
#ifndef CLIPPER_HPP_INCLUDED
|
|
#define CLIPPER_HPP_INCLUDED
|
|
|
|
#include <cstdint>
|
|
|
|
class Clipper {
|
|
public:
|
|
enum ClipperMode {
|
|
kClipperModeSoft,
|
|
kClipperModeHard,
|
|
kClipperModeFold,
|
|
kClipperModeCount
|
|
};
|
|
|
|
Clipper(float init_clip = 1.0f, ClipperMode mode = kClipperModeSoft);
|
|
|
|
void process(const float *in, float *out, uint32_t frames);
|
|
void processStereo(const float *inLeft, const float *inRight, float *outLeft,
|
|
float *outRight, uint32_t frames);
|
|
|
|
private:
|
|
float clip_;
|
|
float clip(const float in);
|
|
ClipperMode mode_;
|
|
|
|
public:
|
|
void setGain(float c) { clip_ = c; }
|
|
float getGain() const { return clip_; }
|
|
void setMode(ClipperMode m) { mode_ = m; }
|
|
ClipperMode getMode() const { return mode_; }
|
|
};
|
|
|
|
#endif // CLIPPER_HPP_INCLUDED
|