]> git.sesse.net Git - nageru/blobdiff - mixer.h
Hook up the level compressor auto checkbox.
[nageru] / mixer.h
diff --git a/mixer.h b/mixer.h
index 6d0cbce1593b6da92c4f426668d948c982683921..682aea4dc24902b6343659867a61e855f7ec0e5c 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -169,6 +169,16 @@ public:
                compressor_enabled = enabled;
        }
 
+       void set_gainstaging_auto(bool enabled)
+       {
+               level_compressor = enabled;
+       }
+
+       void schedule_cut()
+       {
+               should_cut = true;
+       }
+
        void reset_meters();
 
 private:
@@ -252,6 +262,7 @@ private:
        std::thread mixer_thread;
        std::thread audio_thread;
        std::atomic<bool> should_quit{false};
+       std::atomic<bool> should_cut{false};
 
        audio_level_callback_t audio_level_callback = nullptr;
        std::mutex r128_mutex;
@@ -266,6 +277,7 @@ private:
        // First compressor; takes us up to about -12 dBFS.
        StereoCompressor level_compressor;
        float last_gain_staging_db = 0.0f;
+       std::atomic<bool> level_compressor_enabled{true};
 
        static constexpr float ref_level_dbfs = -14.0f;