diff 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
line wrap: on
line diff
--- a/flattendynamics-ladspa.h	Thu Jul 17 12:16:02 2014 +0100
+++ b/flattendynamics-ladspa.h	Thu Jul 17 13:27:07 2014 +0100
@@ -15,9 +15,10 @@
     ~FlattenDynamics();
 
     enum {
-        InputPort     = 0,
-	OutputPort    = 1,
-	PortCount     = 2,
+        AudioInputPort     = 0,
+	AudioOutputPort    = 1,
+        GainOutputPort     = 2,
+	PortCount          = 3,
     };
 
     static const char *const portNames[PortCount];
@@ -35,11 +36,23 @@
 
     void reset();
     void runImpl(unsigned long);
+    float process(float);
+    void updateRMS(float);
     void updateParameters();
 
     int m_sampleRate;
     float *m_input;
     float *m_output;
+    float *m_pgain;
+
+    float *m_history;
+    int m_histlen;
+    int m_histwrite;
+    int m_histread;
+
+    double m_sumOfSquares;
+    float m_rms;
+    float m_gain;
 };
 
 #endif