]> git.sesse.net Git - nageru/blobdiff - nageru/mainwindow.cpp
Make it possible to call set_channel_name() for live and preview.
[nageru] / nageru / mainwindow.cpp
index 73362229ce35e8efc70f9cf5dcfe4c25a6e73037..f2adbf240c94a6e42afe8a2238553075f7cfcc38 100644 (file)
@@ -252,6 +252,9 @@ MainWindow::MainWindow()
        connect(ui->me_live, &GLWidget::transition_names_updated, this, &MainWindow::set_transition_names);
        qRegisterMetaType<Mixer::Output>("Mixer::Output");
 
+       connect(ui->me_live, &GLWidget::name_updated, this, &MainWindow::update_channel_name);
+       connect(ui->me_preview, &GLWidget::name_updated, this, &MainWindow::update_channel_name);
+
        // Hook up the prev/next buttons on the audio views.
        connect(ui->compact_prev_page, &QAbstractButton::clicked, this, &MainWindow::prev_page);
        connect(ui->compact_next_page, &QAbstractButton::clicked, this, &MainWindow::next_page);
@@ -1503,7 +1506,11 @@ void MainWindow::set_transition_names(vector<string> transition_names)
 
 void MainWindow::update_channel_name(Mixer::Output output, const string &name)
 {
-       if (output >= Mixer::OUTPUT_INPUT0) {
+       if (output == Mixer::OUTPUT_LIVE) {
+               ui->label_live->setText(name.c_str());
+       } else if (output == Mixer::OUTPUT_PREVIEW) {
+               ui->label_preview->setText(name.c_str());
+       } else if (output >= Mixer::OUTPUT_INPUT0) {
                unsigned channel = output - Mixer::OUTPUT_INPUT0;
                previews[channel]->label->setText(name.c_str());
        }