+
+ struct sigaction act;
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = schedule_cut_signal;
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGHUP, &act, nullptr);
+
+ // Mostly for debugging. Don't override SIGINT, that's so evil if
+ // shutdown isn't instant.
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = quit_signal;
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGUSR1, &act, nullptr);
+}
+
+void MainWindow::setup_audio_miniview()
+{
+ // Remove any existing channels.
+ for (QLayoutItem *item; (item = ui->faders->takeAt(0)) != nullptr; ) {
+ delete item->widget();
+ delete item;
+ }
+
+ // Set up brand new ones from the input mapping.
+ InputMapping mapping = global_mixer->get_audio_mixer()->get_input_mapping();
+ for (unsigned bus_index = 0; bus_index < mapping.buses.size(); ++bus_index) {
+ QWidget *channel = new QWidget(this);
+ Ui::AudioMiniView *ui_audio_miniview = new Ui::AudioMiniView;
+ ui_audio_miniview->setupUi(channel);
+ ui_audio_miniview->bus_desc_label->setFullText(
+ QString::fromStdString(mapping.buses[bus_index].name));
+ // TODO: Set the fader position.
+ ui->faders->addWidget(channel);
+
+ connect(ui_audio_miniview->fader, &QAbstractSlider::valueChanged,
+ bind(&MainWindow::mini_fader_changed, this, ui_audio_miniview, bus_index, _1));
+ }