]> git.sesse.net Git - nageru/blobdiff - audio_mixer.h
Let settings follow buses when editing the mapping.
[nageru] / audio_mixer.h
index 3a1334a66656e9979cc8ca3148f3c7761acced5e..502a442533440d59e91e60a80707cd7f6c315646 100644 (file)
@@ -63,6 +63,7 @@ public:
 
        std::vector<float> get_output(double pts, unsigned num_samples, ResamplingQueue::RateAdjustmentPolicy rate_adjustment_policy);
 
+       float get_fader_volume(unsigned bus_index) const { return fader_volume_db[bus_index]; }
        void set_fader_volume(unsigned bus_index, float level_db) { fader_volume_db[bus_index] = level_db; }
 
        // Note: This operation holds all ALSA devices (see ALSAPool::get_devices()).
@@ -251,6 +252,22 @@ public:
                }
        }
 
+       // A combination of all settings for a bus. Useful if you want to get
+       // or store them as a whole without bothering to call all of the get_*
+       // or set_* functions for that bus.
+       struct BusSettings {
+               float fader_volume_db;
+               bool locut_enabled;
+               float eq_level_db[NUM_EQ_BANDS];
+               float gain_staging_db;
+               bool level_compressor_enabled;
+               float compressor_threshold_dbfs;
+               bool compressor_enabled;
+       };
+       static BusSettings get_default_bus_settings();
+       BusSettings get_bus_settings(unsigned bus_index) const;
+       void set_bus_settings(unsigned bus_index, const BusSettings &settings);
+
 private:
        struct AudioDevice {
                std::unique_ptr<ResamplingQueue> resampling_queue;