static inline uint64_t DeviceSpec_to_key(const DeviceSpec &device_spec)
{
return (uint64_t(device_spec.type) << 32) | device_spec.index;
static inline uint64_t DeviceSpec_to_key(const DeviceSpec &device_spec)
{
return (uint64_t(device_spec.type) << 32) | device_spec.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.
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.
void reset_resampler_mutex_held(DeviceSpec device_spec);
void reset_alsa_mutex_held(DeviceSpec device_spec);
std::map<DeviceSpec, DeviceInfo> get_devices_mutex_held() const;
void reset_resampler_mutex_held(DeviceSpec device_spec);
void reset_alsa_mutex_held(DeviceSpec device_spec);
std::map<DeviceSpec, DeviceInfo> get_devices_mutex_held() const;
- 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);
std::atomic<float> locut_cutoff_hz;
StereoFilter locut[MAX_BUSES]; // Default cutoff 120 Hz, 24 dB/oct.
std::atomic<bool> locut_enabled[MAX_BUSES];
std::atomic<float> locut_cutoff_hz;
StereoFilter locut[MAX_BUSES]; // Default cutoff 120 Hz, 24 dB/oct.
std::atomic<bool> locut_enabled[MAX_BUSES];
std::atomic<float> compressor_threshold_dbfs[MAX_BUSES];
std::atomic<bool> compressor_enabled[MAX_BUSES];
std::atomic<float> compressor_threshold_dbfs[MAX_BUSES];
std::atomic<bool> compressor_enabled[MAX_BUSES];
- float current_level = 0.0f; // Peak of the last frame (not in dB).
- float current_peak = 0.0f; // Current peak of the peak meter (not in dB).
+ float current_level = 0.0f; // Peak of the last frame.
+ float historic_peak = 0.0f; // Highest peak since last reset; no falloff.
+ float current_peak = 0.0f; // Current peak of the peak meter.
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 }};
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 }};