[vlc-devel] [PATCH] qt: show mmdevice passthrough option

Thomas Guillem thomas at gllm.fr
Fri Dec 15 11:09:50 CET 2017


---
 modules/gui/qt/components/simple_preferences.cpp | 11 +++++++++
 modules/gui/qt/ui/sprefs_audio.ui                | 30 ++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index d848ca9e0b..3ce17bed40 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -487,6 +487,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_GENERIC( "audio-language" , String , ui.langLabel,
                             preferredAudioLanguage );
 
+            CONFIG_GENERIC( "mmdevice-passthrough", IntegerList,
+                            ui.mmdevicePassthroughLabel, mmdevicePassthroughBox );
+
             CONFIG_BOOL( "spdif", spdifBox );
             CONFIG_GENERIC( "force-dolby-surround", IntegerList, ui.dolbyLabel,
                             detectionDolby );
@@ -516,6 +519,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             ui.volumeValue->setButtonSymbols(QAbstractSpinBox::NoButtons);
             optionWidgets["volLW"] = ui.volumeValue;
             optionWidgets["headphoneB"] = ui.headphoneEffect;
+            optionWidgets["mmdevicePassthroughL"] = ui.mmdevicePassthroughLabel;
+            optionWidgets["mmdevicePassthroughB"] = ui.mmdevicePassthroughBox;
             optionWidgets["spdifChB"] = ui.spdifBox;
             optionWidgets["defaultVolume"] = ui.defaultVolume;
             optionWidgets["resetVolumeCheckbox"] = ui.resetVolumeCheckbox;
@@ -917,6 +922,12 @@ void SPrefsPanel::updateAudioOptions( int number)
     QString value = qobject_cast<QComboBox *>(optionWidgets["audioOutCoB"])
                                             ->itemData( number ).toString();
 #ifdef _WIN32
+    /* Since MMDevice is most likely to be used by default, we show MMDevice
+     * options by default */
+    const bool mmDeviceEnabled = value == "mmdevice" || value == "any";
+    optionWidgets["mmdevicePassthroughL"]->setVisible( mmDeviceEnabled );
+    optionWidgets["mmdevicePassthroughB"]->setVisible( mmDeviceEnabled );
+
     optionWidgets["directxW"]->setVisible( ( value == "directsound" ) );
     optionWidgets["directxL"]->setVisible( ( value == "directsound" ) );
     optionWidgets["waveoutW"]->setVisible( ( value == "waveout" ) );
diff --git a/modules/gui/qt/ui/sprefs_audio.ui b/modules/gui/qt/ui/sprefs_audio.ui
index 3551d348a6..1f90e08f65 100644
--- a/modules/gui/qt/ui/sprefs_audio.ui
+++ b/modules/gui/qt/ui/sprefs_audio.ui
@@ -252,6 +252,35 @@
            </property>
           </widget>
          </item>
+         <item row="4" column="0">
+          <widget class="QLabel" name="mmdevicePassthroughLabel">
+           <property name="minimumSize">
+            <size>
+             <width>250</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>HDMI/SPDIF audio passthrough:</string>
+           </property>
+           <property name="buddy">
+            <cstring>mmdevicePassthrough</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QComboBox" name="mmdevicePassthroughBox">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+          </widget>
+         </item>
         </layout>
        </widget>
       </item>
@@ -591,6 +620,7 @@
   <tabstop>fileName</tabstop>
   <tabstop>fileBrowseButton</tabstop>
   <tabstop>spdifBox</tabstop>
+  <tabstop>mmdevicePassthroughBox</tabstop>
   <tabstop>autoscaleBox</tabstop>
   <tabstop>volNormBox</tabstop>
   <tabstop>volNormSpin</tabstop>
-- 
2.11.0



More information about the vlc-devel mailing list