#include "mainwindow.h"
-#include "window.h"
#include <thread>
#include <vector>
#include <string>
Q_DECLARE_METATYPE(std::vector<std::string>);
+MainWindow *global_mainwindow = nullptr;
+
MainWindow::MainWindow()
: ui(new Ui::MainWindow)
{
+ global_mainwindow = this;
ui->setupUi(this);
ui->me_live->set_output(Mixer::OUTPUT_LIVE);
QMetaObject::invokeMethod(this, "relayout", Qt::QueuedConnection);
}
+void MainWindow::mixer_created(Mixer *mixer)
+{
+ mixer->set_audio_level_callback([this](float level_lufs, float peak_db, float global_level_lufs, float range_low_lufs, float range_high_lufs){
+ ui->vu_meter->set_level(level_lufs);
+ ui->lra_meter->set_levels(global_level_lufs, range_low_lufs, range_high_lufs);
+
+ char buf[256];
+ snprintf(buf, sizeof(buf), "%.1f", peak_db);
+ ui->peak_display->setText(buf);
+ if (peak_db > -0.1f) { // -0.1 dBFS is EBU peak limit.
+ ui->peak_display->setStyleSheet("QLabel { background-color: red; color: white; }");
+ } else {
+ ui->peak_display->setStyleSheet("");
+ }
+ });
+}
+
void MainWindow::relayout()
{
int width = size().width();