comparison flattendynamics-ladspa.h @ 1:f21753c504e1

Add gain output port, update rms values
author Chris Cannam
date Thu, 17 Jul 2014 13:27:07 +0100
parents 7632b9bf0cff
children 6b732542a34c
comparison
equal deleted inserted replaced
0:7632b9bf0cff 1:f21753c504e1
13 private: 13 private:
14 FlattenDynamics(int sampleRate); 14 FlattenDynamics(int sampleRate);
15 ~FlattenDynamics(); 15 ~FlattenDynamics();
16 16
17 enum { 17 enum {
18 InputPort = 0, 18 AudioInputPort = 0,
19 OutputPort = 1, 19 AudioOutputPort = 1,
20 PortCount = 2, 20 GainOutputPort = 2,
21 PortCount = 3,
21 }; 22 };
22 23
23 static const char *const portNames[PortCount]; 24 static const char *const portNames[PortCount];
24 static const LADSPA_PortDescriptor ports[PortCount]; 25 static const LADSPA_PortDescriptor ports[PortCount];
25 static const LADSPA_PortRangeHint hints[PortCount]; 26 static const LADSPA_PortRangeHint hints[PortCount];
33 static void deactivate(LADSPA_Handle); 34 static void deactivate(LADSPA_Handle);
34 static void cleanup(LADSPA_Handle); 35 static void cleanup(LADSPA_Handle);
35 36
36 void reset(); 37 void reset();
37 void runImpl(unsigned long); 38 void runImpl(unsigned long);
39 float process(float);
40 void updateRMS(float);
38 void updateParameters(); 41 void updateParameters();
39 42
40 int m_sampleRate; 43 int m_sampleRate;
41 float *m_input; 44 float *m_input;
42 float *m_output; 45 float *m_output;
46 float *m_pgain;
47
48 float *m_history;
49 int m_histlen;
50 int m_histwrite;
51 int m_histread;
52
53 double m_sumOfSquares;
54 float m_rms;
55 float m_gain;
43 }; 56 };
44 57
45 #endif 58 #endif