X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=audio_mixer.h;h=9793646c9bac3493651e39643a610c7df75c5d0f;hb=6ffaabac0a523617b686f40c154a25cb548cc561;hp=ebe142a74cbc9e6f81d125505022d88588cb00cd;hpb=80a2892bbe07a4e065704830e9e7244d2b1139fa;p=nageru diff --git a/audio_mixer.h b/audio_mixer.h index ebe142a..9793646 100644 --- a/audio_mixer.h +++ b/audio_mixer.h @@ -142,6 +142,18 @@ public: return locut_enabled[bus]; } + bool is_mono(unsigned bus_index); + + void set_stereo_width(unsigned bus_index, float width) + { + stereo_width[bus_index] = width; + } + + float get_stereo_width(unsigned bus_index) + { + return stereo_width[bus_index]; + } + void set_eq(unsigned bus_index, EQBand band, float db_gain) { assert(band >= 0 && band < NUM_EQ_BANDS); @@ -289,6 +301,7 @@ public: float fader_volume_db; bool muted; bool locut_enabled; + float stereo_width; float eq_level_db[NUM_EQ_BANDS]; float gain_staging_db; bool level_compressor_enabled; @@ -317,7 +330,7 @@ private: AudioDevice *find_audio_device(DeviceSpec device_spec); void find_sample_src_from_device(const std::map> &samples_card, DeviceSpec device_spec, int source_channel, const float **srcptr, unsigned *stride); - void fill_audio_bus(const std::map> &samples_card, const InputMapping::Bus &bus, unsigned num_samples, float *output); + void fill_audio_bus(const std::map> &samples_card, const InputMapping::Bus &bus, unsigned num_samples, float stereo_width, float *output); void reset_resampler_mutex_held(DeviceSpec device_spec); void apply_eq(unsigned bus_index, std::vector *samples_bus); void update_meters(const std::vector &samples); @@ -376,6 +389,7 @@ private: std::atomic fader_volume_db[MAX_BUSES] {{ 0.0f }}; std::atomic mute[MAX_BUSES] {{ false }}; float last_fader_volume_db[MAX_BUSES] { 0.0f }; // Under audio_mutex. + std::atomic stereo_width[MAX_BUSES] {{ 0.0f }}; // Default 1.0f (is set in constructor). std::atomic eq_level_db[MAX_BUSES][NUM_EQ_BANDS] {{{ 0.0f }}}; float last_eq_level_db[MAX_BUSES][NUM_EQ_BANDS] {{ 0.0f }};