1 /**
2  *  Compressor Model Implementation
3  *
4  *  Copyright (C) 2006-2018 Teru Kamogashira
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20 
_FV3_(compmodel)21 class _FV3_(compmodel)
22 {
23  public:
24   _FV3_(compmodel)();
25   void         setSampleRate(_fv3_float_t fs);
26   _fv3_float_t getSampleRate();
27   void setRMS(_fv3_float_t msec);
28   _fv3_float_t getRMS();
29   void setLookahead(_fv3_float_t msec);
30   _fv3_float_t getLookahead();
31   void setAttack(_fv3_float_t msec);
32   _fv3_float_t getAttack();
33   void setRelease(_fv3_float_t msec);
34   _fv3_float_t getRelease();
35   void setThreshold(_fv3_float_t dB);
36   _fv3_float_t getThreshold();
37   void setSoftKnee(_fv3_float_t dB);
38   _fv3_float_t getSoftKnee();
39   void setRatio(_fv3_float_t value);
40   _fv3_float_t getRatio();
41   long getLatency();
42   _fv3_float_t getCGain();
43   void mute();
44   void processreplace(_fv3_float_t *inputL, _fv3_float_t *inputR, _fv3_float_t *outputL, _fv3_float_t *outputR, long numsamples);
45   _fv3_float_t getEnv();
46   void printconfig();
47 
48  private:
49   _FV3_(compmodel)(const _FV3_(compmodel)& x);
50   _FV3_(compmodel)& operator=(const _FV3_(compmodel)& x);
51   _fv3_float_t currentfs, RMS, Lookahead, Attack, Release, Threshold, Ratio, SoftKnee;
52   _FV3_(scomp) compL, compR;
53   _FV3_(delay) lookaL, lookaR;
54   _fv3_float_t currentGain;
55 };
56