]> git.sesse.net Git - nageru/blobdiff - mixer.h
Make the level compressor much slower.
[nageru] / mixer.h
diff --git a/mixer.h b/mixer.h
index 33f3a982cbb0519241224bbe67aa605d3b373f56..312566d891e0371eac7ebf765299480fec074f42 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -29,6 +29,8 @@
 #include "resampler.h"
 #include "theme.h"
 #include "timebase.h"
+#include "stereocompressor.h"
+#include "filter.h"
 
 class H264Encoder;
 class QSurface;
@@ -95,7 +97,9 @@ public:
                output_channel[output].set_frame_ready_callback(callback);
        }
 
-       typedef std::function<void(float, float, float, float, float)> audio_level_callback_t;
+       typedef std::function<void(float level_lufs, float peak_db,
+                                  float global_level_lufs, float range_low_lufs, float range_high_lufs,
+                                  float auto_gain_staging_db)> audio_level_callback_t;
        void set_audio_level_callback(audio_level_callback_t callback)
        {
                audio_level_callback = callback;
@@ -203,6 +207,12 @@ private:
 
        // TODO: Implement oversampled peak detection.
        float peak = 0.0f;
+
+       StereoFilter locut;  // Cutoff 150 Hz, 24 dB/oct.
+
+       // First compressor; takes us up to about -12 dBFS.
+       StereoCompressor level_compressor;
+       float last_gain_staging_db = 0.0f;
 };
 
 extern Mixer *global_mixer;