connect(ui_display->wb_button, &QPushButton::clicked, std::bind(&MainWindow::wb_button_clicked, this, i));
}
+ connect(ui->locut_cutoff_knob, &QDial::valueChanged, [this](int value) {
+ float octaves = value * 0.1f;
+ float cutoff_hz = 20.0 * pow(2.0, octaves);
+ global_mixer->set_locut_cutoff(cutoff_hz);
+
+ char buf[256];
+ snprintf(buf, sizeof(buf), "%ld Hz", lrintf(cutoff_hz));
+ ui->locut_cutoff_display->setText(buf);
+ });
+
mixer->set_audio_level_callback([this](float level_lufs, float peak_db, float global_level_lufs, float range_low_lufs, float range_high_lufs, float auto_gain_staging_db){
post_to_main_thread([=]() {
ui->vu_meter->set_level(level_lufs);
// Cut away everything under 150 Hz; we don't need it for voice,
// and it will reduce headroom and confuse the compressor.
// (In particular, any hums at 50 or 60 Hz should be dampened.)
- locut.render(samples_out.data(), samples_out.size() / 2, 150.0 * 2.0 * M_PI / OUTPUT_FREQUENCY, 0.5f);
+ locut.render(samples_out.data(), samples_out.size() / 2, locut_cutoff_hz * 2.0 * M_PI / OUTPUT_FREQUENCY, 0.5f);
// Apply a level compressor to get the general level right.
// Basically, if it's over about -40 dBFS, we squeeze it down to that level
#include <movit/effect_chain.h>
#include <movit/flat_input.h>
+#include <atomic>
#include <condition_variable>
#include <cstddef>
#include <functional>
theme->set_wb(channel, r, g, b);
}
+ void set_locut_cutoff(float cutoff_hz)
+ {
+ locut_cutoff_hz = cutoff_hz;
+ }
+
private:
void bm_frame(unsigned card_index, uint16_t timecode,
FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format,
// TODO: Implement oversampled peak detection.
float peak = 0.0f;
- StereoFilter locut; // Cutoff 150 Hz, 24 dB/oct.
+ StereoFilter locut; // Default cutoff 150 Hz, 24 dB/oct.
+ std::atomic<float> locut_cutoff_hz;
// First compressor; takes us up to about -12 dBFS.
StereoCompressor level_compressor;
</widget>
</item>
<item row="1" column="0">
- <widget class="QDial" name="dial_2">
+ <widget class="QDial" name="locut_cutoff_knob">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
</widget>
</item>
<item row="2" column="0">
- <widget class="QLabel" name="label_4">
+ <widget class="QLabel" name="locut_cutoff_display">
<property name="text">
<string>150 Hz</string>
</property>