[vlc-commits] qt: display directx rendering options only when vout is set to directx

Pierre Lamot git at videolan.org
Thu Jan 25 17:58:26 CET 2018


vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Jan 25 14:52:19 2018 +0100| [7526658131dc6b222f156593b2ad5e2c81737f72] | committer: Jean-Baptiste Kempf

qt: display directx rendering options only when vout is set to directx

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit e7d528fe5621875c4df6b272a51742dbb5278de8)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7526658131dc6b222f156593b2ad5e2c81737f72
---

 modules/gui/qt/components/simple_preferences.cpp | 18 ++++++++++++++++++
 modules/gui/qt/components/simple_preferences.hpp |  1 +
 2 files changed, 19 insertions(+)

diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index 7121998135..461201b47a 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -362,6 +362,10 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_BOOL( "video-deco", windowDecorations );
             CONFIG_GENERIC( "vout", StringList, ui.voutLabel, outputModule );
 
+            CONNECT( ui.outputModule, currentIndexChanged( int ),
+                     this, updateVideoOptions( int ) );
+            optionWidgets["videoOutCoB"] = ui.outputModule;
+
             optionWidgets["fullscreenScreenB"] = ui.fullscreenScreenBox;
             ui.fullscreenScreenBox->addItem( qtr("Automatic"), -1 );
             int i_screenCount = 0;
@@ -384,6 +388,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_BOOL( "directx-overlay", overlay );
             CONFIG_BOOL( "directx-hw-yuv", hwYUVBox );
             CONNECT( ui.overlay, toggled( bool ), ui.hwYUVBox, setEnabled( bool ) );
+            optionWidgets["directxVideoB"] = ui.directXBox;
 #else
             ui.directXBox->setVisible( false );
 #endif
@@ -407,6 +412,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                             snapshotsSequentialNumbering );
             CONFIG_GENERIC( "snapshot-format", StringList, ui.arLabel,
                             snapshotsFormat );
+
+            updateVideoOptions( ui.outputModule->currentIndex() );
          END_SPREFS_CAT;
 
         /******************************
@@ -932,6 +939,17 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 #undef CONFIG_BOOL
 }
 
+void SPrefsPanel::updateVideoOptions( int number )
+{
+    QString value = qobject_cast<QComboBox *>(optionWidgets["videoOutCoB"])
+                                            ->itemData( number ).toString();
+#ifdef _WIN32
+    if( optionWidgets["directxVideoB"] ) {
+        optionWidgets["directxVideoB"]->setVisible( ( value == "directdraw" ) );
+    }
+#endif
+}
+
 
 void SPrefsPanel::updateAudioOptions( int number)
 {
diff --git a/modules/gui/qt/components/simple_preferences.hpp b/modules/gui/qt/components/simple_preferences.hpp
index 6390b21efd..856b88ba97 100644
--- a/modules/gui/qt/components/simple_preferences.hpp
+++ b/modules/gui/qt/components/simple_preferences.hpp
@@ -117,6 +117,7 @@ private:
 /* Display only the options for the selected audio output */
 private slots:
     void lastfm_Changed( int );
+    void updateVideoOptions( int );
     void updateAudioOptions( int );
     void updateAudioVolume( int );
     void langChanged( int );



More information about the vlc-commits mailing list