]> git.sesse.net Git - nageru/commitdiff
Hook up all three transition buttons to the theme.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 8 Oct 2015 20:34:14 +0000 (22:34 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 8 Oct 2015 20:34:14 +0000 (22:34 +0200)
mainwindow.cpp
mainwindow.h
ui_mainwindow.ui

index 99b7974e4abcb07461460e5701a409e95e36354e..a3736709531c451b28c6bc7443774c4fb8795606 100644 (file)
@@ -14,7 +14,6 @@ MainWindow::MainWindow()
 {
        Ui::MainWindow *ui = new Ui::MainWindow;
        ui->setupUi(this);
-       connect(ui->cut_btn, SIGNAL(clicked()), this, SLOT(cut()));
 
        ui->me_live->set_output(Mixer::OUTPUT_LIVE);
        ui->me_preview->set_output(Mixer::OUTPUT_PREVIEW);
@@ -24,19 +23,35 @@ MainWindow::MainWindow()
        ui->preview2->set_output(Mixer::OUTPUT_INPUT1);
        ui->preview3->set_output(Mixer::OUTPUT_INPUT2);
 
-       QSignalMapper *mapper = new QSignalMapper(this);
-       mapper->setMapping(ui->preview1, 0),
-       mapper->setMapping(ui->preview2, 1);
-       mapper->setMapping(ui->preview3, 2);
-       connect(ui->preview1, SIGNAL(clicked()), mapper, SLOT(map()));
-       connect(ui->preview2, SIGNAL(clicked()), mapper, SLOT(map()));
-       connect(ui->preview3, SIGNAL(clicked()), mapper, SLOT(map()));
-       connect(mapper, SIGNAL(mapped(int)), this, SLOT(channel_clicked(int)));
+       // Hook up the preview clicks.
+       {
+               QSignalMapper *mapper = new QSignalMapper(this);
+               mapper->setMapping(ui->preview1, 0),
+               mapper->setMapping(ui->preview2, 1);
+               mapper->setMapping(ui->preview3, 2);
+               connect(ui->preview1, SIGNAL(clicked()), mapper, SLOT(map()));
+               connect(ui->preview2, SIGNAL(clicked()), mapper, SLOT(map()));
+               connect(ui->preview3, SIGNAL(clicked()), mapper, SLOT(map()));
+               connect(mapper, SIGNAL(mapped(int)), this, SLOT(channel_clicked(int)));
+       }
+
+       // Hook up the transition buttons.
+       // TODO: Make them dynamic.
+       {
+               QSignalMapper *mapper = new QSignalMapper(this);
+               mapper->setMapping(ui->transition_btn1, 0),
+               mapper->setMapping(ui->transition_btn2, 1);
+               mapper->setMapping(ui->transition_btn3, 2);
+               connect(ui->transition_btn1, SIGNAL(clicked()), mapper, SLOT(map()));
+               connect(ui->transition_btn2, SIGNAL(clicked()), mapper, SLOT(map()));
+               connect(ui->transition_btn3, SIGNAL(clicked()), mapper, SLOT(map()));
+               connect(mapper, SIGNAL(mapped(int)), this, SLOT(transition_clicked(int)));
+       }
 }
 
-void MainWindow::cut()
+void MainWindow::transition_clicked(int transition_number)
 {
-       global_mixer->transition_clicked(0);  // FIXME: real value
+       global_mixer->transition_clicked(transition_number);
 }
 
 void MainWindow::channel_clicked(int channel_number)
index edea126568e133661c1d9ca7c58096e3674ed6d1..6db9a09cdccc1e4f531dbd83a828933367f5f102 100644 (file)
@@ -11,8 +11,8 @@ public:
        MainWindow();
 
 public slots:
-       void cut();
-       void channel_clicked(int id);
+       void transition_clicked(int transition_number);
+       void channel_clicked(int channel_number);
 };
 
 #endif
index 8b143d8c25fe6f97e89c4fc90da8957705a163b7..fa8bbe0d4c45d895bba544be49b97c1a6f295e78 100644 (file)
         <item>
          <layout class="QVBoxLayout" name="verticalLayout_2">
           <item>
-           <widget class="QPushButton" name="cut_btn">
+           <widget class="QPushButton" name="transition_btn1">
             <property name="text">
              <string>Cut</string>
             </property>
            </widget>
           </item>
           <item>
-           <widget class="QPushButton" name="fade_btn">
+           <widget class="QPushButton" name="transition_btn2">
             <property name="text">
              <string>Fade</string>
             </property>
            </widget>
           </item>
           <item>
-           <widget class="QPushButton" name="wipe_btn">
+           <widget class="QPushButton" name="transition_btn3">
             <property name="text">
              <string>Wipe</string>
             </property>