connect(ui->locut_cutoff_knob, &QDial::valueChanged, this, &MainWindow::cutoff_knob_changed);
cutoff_knob_changed(ui->locut_cutoff_knob->value());
+ connect(ui->gainstaging_auto_checkbox, &QCheckBox::stateChanged, [this](int state){
+ global_mixer->set_gainstaging_auto(state == Qt::Checked);
+ });
+
connect(ui->limiter_threshold_knob, &QDial::valueChanged, this, &MainWindow::limiter_threshold_knob_changed);
connect(ui->compressor_threshold_knob, &QDial::valueChanged, this, &MainWindow::compressor_threshold_knob_changed);
connect(ui->limiter_enabled, &QCheckBox::stateChanged, [this](int state){
// then apply a makeup gain to get it to -14 dBFS. -14 dBFS is, of course,
// entirely arbitrary, but from practical tests with speech, it seems to
// put ut around -23 LUFS, so it's a reasonable starting point for later use.
- {
+ if (level_compressor_enabled) {
float threshold = 0.01f; // -40 dBFS.
float ratio = 20.0f;
float attack_time = 0.5f;
compressor_enabled = enabled;
}
+ void set_gainstaging_auto(bool enabled)
+ {
+ level_compressor = enabled;
+ }
+
void schedule_cut()
{
should_cut = true;
// 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;