]> git.sesse.net Git - nageru/commitdiff
Add a beginning UI for mapping inputs. No logic connected yet.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 30 Jul 2016 10:23:44 +0000 (12:23 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Oct 2016 22:55:44 +0000 (00:55 +0200)
.gitignore
Makefile
input_mapping_dialog.h [new file with mode: 0644]
mainwindow.cpp
mainwindow.h
ui_input_mapping.ui [new file with mode: 0644]
ui_mainwindow.ui

index 40faeedba019bdda59c15dbd405cd673da09d97c..070c8fc9610f3619dd611a5b5d9e1e8f6be206d5 100644 (file)
@@ -4,5 +4,6 @@
 ui_aboutdialog.h
 ui_audio_miniview.h
 ui_display.h
+ui_input_mapping.h
 ui_mainwindow.h
 nageru
index 9cdc9cdbe0cd901340ad0e410dfc84ecd18db6c2..8479712db521d7055c09e491fa6aa4e8f61085f5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,8 @@ endif
 LDLIBS=$(shell pkg-config --libs $(PKG_MODULES)) -pthread -lva -lva-drm -lva-x11 -lX11 -lavformat -lavcodec -lavutil -lswscale -lavresample -lzita-resampler -lasound -ldl
 
 # Qt objects
-OBJS=glwidget.o main.o mainwindow.o vumeter.o lrameter.o vu_common.o correlation_meter.o aboutdialog.o
-OBJS += glwidget.moc.o mainwindow.moc.o vumeter.moc.o lrameter.moc.o correlation_meter.moc.o aboutdialog.moc.o ellipsis_label.moc.o
+OBJS=glwidget.o main.o mainwindow.o vumeter.o lrameter.o vu_common.o correlation_meter.o aboutdialog.o input_mapping_dialog.o
+OBJS += glwidget.moc.o mainwindow.moc.o vumeter.moc.o lrameter.moc.o correlation_meter.moc.o aboutdialog.moc.o ellipsis_label.moc.o input_mapping_dialog.moc.o
 
 # Mixer objects
 OBJS += mixer.o audio_mixer.o pbo_frame_allocator.o context.o ref_counted_frame.o theme.o resampling_queue.o httpd.o ebu_r128_proc.o flags.o image_input.o stereocompressor.o filter.o alsa_output.o correlation_measurer.o disk_space_estimator.o
@@ -50,6 +50,8 @@ mainwindow.o: mainwindow.cpp ui_mainwindow.h ui_display.h ui_audio_miniview.h
 
 aboutdialog.o: aboutdialog.cpp ui_aboutdialog.h
 
+input_mapping_dialog.o: input_mapping_dialog.cpp ui_input_mapping.h
+
 DEPS=$(OBJS:.o=.d)
 -include $(DEPS)
 
diff --git a/input_mapping_dialog.h b/input_mapping_dialog.h
new file mode 100644 (file)
index 0000000..c7fea24
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _INPUT_MAPPING_DIALOG_H
+#define _INPUT_MAPPING_DIALOG_H
+
+#include <QDialog>
+#include <string>
+#include <vector>
+#include <sys/time.h>
+
+#include "mixer.h"
+
+namespace Ui {
+class InputMappingDialog;
+}  // namespace Ui
+
+class InputMappingDialog : public QDialog
+{
+       Q_OBJECT
+
+public:
+       InputMappingDialog();
+
+private:
+       Ui::InputMappingDialog *ui;
+};
+
+#endif  // !defined(_INPUT_MAPPING_DIALOG_H)
index f13b4ea355249ce59f8688bd381454befb279ea4..23d76ab8a16c0bd101e9d1ee4393525142194efa 100644 (file)
@@ -22,6 +22,7 @@
 #include "disk_space_estimator.h"
 #include "flags.h"
 #include "glwidget.h"
+#include "input_mapping_dialog.h"
 #include "lrameter.h"
 #include "mixer.h"
 #include "post_to_main_thread.h"
@@ -109,6 +110,7 @@ MainWindow::MainWindow()
        connect(ui->cut_action, &QAction::triggered, this, &MainWindow::cut_triggered);
        connect(ui->exit_action, &QAction::triggered, this, &MainWindow::exit_triggered);
        connect(ui->about_action, &QAction::triggered, this, &MainWindow::about_triggered);
+       connect(ui->input_mapping_action, &QAction::triggered, this, &MainWindow::input_mapping_triggered);
 
        if (global_flags.x264_video_to_http) {
                connect(ui->x264_bitrate_action, &QAction::triggered, this, &MainWindow::x264_bitrate_triggered);
@@ -278,6 +280,11 @@ void MainWindow::about_triggered()
        AboutDialog().exec();
 }
 
+void MainWindow::input_mapping_triggered()
+{
+       InputMappingDialog().exec();
+}
+
 void MainWindow::gain_staging_knob_changed(int value)
 {
        ui->gainstaging_auto_checkbox->setCheckState(Qt::Unchecked);
index c44c0f2c22cbfb86e479d020e4c3ec7d179bfe06..80525162ba5d61ad5e8699a5afa16743b35f1f98 100644 (file)
@@ -39,6 +39,7 @@ public slots:
        void x264_bitrate_triggered();
        void exit_triggered();
        void about_triggered();
+       void input_mapping_triggered();
        void transition_clicked(int transition_number);
        void channel_clicked(int channel_number);
        void wb_button_clicked(int channel_number);
diff --git a/ui_input_mapping.ui b/ui_input_mapping.ui
new file mode 100644 (file)
index 0000000..82a0d3d
--- /dev/null
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>InputMappingDialog</class>
+ <widget class="QDialog" name="Dialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>879</width>
+    <height>583</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Input mapping</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QTableWidget" name="tableWidget">
+     <column>
+      <property name="text">
+       <string>Device</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Left input</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Right input</string>
+      </property>
+     </column>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1,0,0,1,0">
+     <item>
+      <widget class="QPushButton" name="pushButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>30</width>
+         <height>30</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset theme="list-add"/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_2">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>30</width>
+         <height>30</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset theme="list-remove">
+         <normaloff>.</normaloff>.</iconset>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_3">
+       <property name="maximumSize">
+        <size>
+         <width>30</width>
+         <height>30</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset theme="go-up"/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_4">
+       <property name="maximumSize">
+        <size>
+         <width>30</width>
+         <height>30</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+       <property name="icon">
+        <iconset theme="go-down"/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>Dialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>Dialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index e006c9aeee1607204ddb7b728517434fca5febbd..3a55b88b34810d4479c46348bd00f796ad40c0ef 100644 (file)
     </property>
     <addaction name="about_action"/>
    </widget>
+   <widget class="QMenu" name="menu_Audio">
+    <property name="title">
+     <string>&amp;Audio</string>
+    </property>
+    <addaction name="input_mapping_action"/>
+   </widget>
    <addaction name="menuWhat"/>
+   <addaction name="menu_Audio"/>
    <addaction name="menu_Help"/>
   </widget>
   <action name="exit_action">
     <string>Change &amp;x264 bitrateā€¦</string>
    </property>
   </action>
+  <action name="input_mapping_action">
+   <property name="text">
+    <string>&amp;Input mappingā€¦</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>