]> git.sesse.net Git - nageru/blobdiff - audio_mixer.h
Add support for EQ filters to the Filter class.
[nageru] / audio_mixer.h
index 5d65582c939fa191bcf8efad870d6e1c65b65c25..88c2f880cac0fee500d087abec37d1ff9eed1230 100644 (file)
@@ -201,6 +201,8 @@ public:
                return final_makeup_gain_auto;
        }
 
+       void reset_peak(unsigned bus_index);
+
        struct BusLevel {
                float current_level_dbfs[2];  // Digital peak of last frame, left and right.
                float peak_level_dbfs[2];  // Digital peak with hold, left and right.
@@ -238,7 +240,8 @@ private:
        void reset_alsa_mutex_held(DeviceSpec device_spec);
        std::map<DeviceSpec, DeviceInfo> get_devices_mutex_held() const;
        void update_meters(const std::vector<float> &samples);
-       void measure_bus_levels(unsigned bus_index, const std::vector<float> &left, const std::vector<float> &right, float volume);
+       void add_bus_to_master(unsigned bus_index, const std::vector<float> &samples_bus, std::vector<float> *samples_out);
+       void measure_bus_levels(unsigned bus_index, const std::vector<float> &left, const std::vector<float> &right);
        void send_audio_level_callback();
 
        unsigned num_cards;
@@ -279,13 +282,14 @@ private:
                float last_peak = 0.0f;
                float age_seconds = 0.0f;   // Time since "last_peak" was set.
        };
-       PeakHistory peak_history[MAX_BUSES][2];  // Separate for each channel.
+       PeakHistory peak_history[MAX_BUSES][2];  // Separate for each channel. Under audio_mutex.
 
        double final_makeup_gain = 1.0;  // Under compressor_mutex. Read/write by the user. Note: Not in dB, we want the numeric precision so that we can change it slowly.
        bool final_makeup_gain_auto = true;  // Under compressor_mutex.
 
        InputMapping input_mapping;  // Under audio_mutex.
        std::atomic<float> fader_volume_db[MAX_BUSES] {{ 0.0f }};
+       float last_fader_volume_db[MAX_BUSES] { 0.0f };  // Under audio_mutex.
 
        audio_level_callback_t audio_level_callback = nullptr;
        mutable std::mutex audio_measure_mutex;