1 /* 2 rakarrack - a guitar effects software 3 4 Compressor.h - Compressor Effect definitions 5 Based on artscompressor.cc by Matthias Kretz <kretz@kde.org> 6 Stefan Westerfeld <stefan@space.twc.de> 7 8 Copyright (C) 2008-2010 Josep Andreu 9 Author: Josep Andreu & Ryan Billing 10 11 This program is free software; you can redistribute it and/or modify 12 it under the terms of version 2 of the GNU General Public License 13 as published by the Free Software Foundation. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License (version 2) for more details. 19 20 You should have received a copy of the GNU General Public License 21 (version2) along with this program; if not, write to the Free Software 22 Foundation, 23 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 25 */ 26 27 28 #ifndef COMPRESSOR_H 29 #define COMPRESSOR_H 30 31 #include "FPreset.h" 32 33 class Compressor 34 { 35 36 public: 37 38 Compressor (float * efxoutl_, float * efxoutr_, double samplerate); 39 ~Compressor (); 40 41 void out (float * smps_l, float * smps_r, uint32_t period); 42 43 void Compressor_Change (int np, int value); 44 void Compressor_Change_Preset (int dgui,int npreset); 45 int getpar (int npar); 46 void cleanup (); 47 48 float *efxoutl; 49 float *efxoutr; 50 51 52 53 // Compressor 54 55 int tatt; // attack time (ms) 56 int trel; // release time (ms) 57 int tratio; 58 int toutput; 59 int tthreshold; 60 int a_out; 61 int stereo; 62 int tknee; 63 int peak; 64 int clipping; 65 int limit; 66 67 private: 68 69 float rvolume; 70 float lvolume; 71 float rvolume_db; 72 float lvolume_db; 73 float thres_db; // threshold 74 float knee; 75 float thres_mx; 76 float kpct; 77 float ratio; // ratio 78 float kratio; // ratio maximum for knee region 79 float eratio; // dynamic ratio 80 float makeup; // make-up gain 81 float makeuplin; 82 83 float outlevel; 84 float att, attr, attl; 85 float rel, relr, rell; 86 float relcnst, attconst; 87 int ltimer, rtimer, hold; 88 89 float rgain; 90 float rgain_old; 91 92 float lgain; 93 float lgain_old; 94 95 float lgain_t; 96 float rgain_t; 97 98 float coeff_kratio; 99 float coeff_ratio; 100 float coeff_knee; 101 float coeff_kk; 102 float lpeak; 103 float rpeak; 104 105 class FPreset *Fpre; 106 107 float cSAMPLE_RATE; 108 109 }; 110 111 #endif 112