trunk 20080912
[gitenigma.git] / include / lib / driver / audiodynamic.h
blobb355aa6cbe6a1c694817d7f985a05e48b84a5cdb
1 #ifndef __lib_driver_audiodynamic_h
2 #define __lib_driver_audiodynamic_h
4 class eAudioDynamicCompression: public Object
6 struct arg_s
8 int num;
9 int clear;
10 unsigned long long dst;
11 int dst_n;
13 eTimer pollTimer;
14 int fd;
15 int current_value;
17 int last_val[100]; // the last 10 seconds
18 int last_ptr;
20 int read_rms(int i);
21 int hyst_low, hyst_hi;
22 int current_fast, current_slow;
23 int enabled;
25 void doPoll();
26 static eAudioDynamicCompression *instance;
27 public:
28 static eAudioDynamicCompression *getInstance()
30 return instance;
33 int getCurrent() { if (!enabled) doPoll(); return current_value; }
34 void setEnable(int enable);
35 int getEnable() { return enabled; }
36 int getMax() { return hyst_hi; }
37 void setMax(int h) { hyst_hi = h; hyst_low = h / 2; }
39 eAudioDynamicCompression();
40 ~eAudioDynamicCompression();
43 #endif