[vlc-devel] [PATCH 1/2] qt: display directx rendering options only when vout is set to directx

Romain Vimont rom at rom1v.com
Fri Jan 26 08:45:24 CET 2018


On Thu, Jan 25, 2018 at 02:52:19PM +0100, Pierre Lamot wrote:
> ---
>  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();

nitpick: value should be inside the ifdef-block (even the if-block),
since it is unused when _WIN32 is not defined.

> +#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 );
> -- 
> 2.14.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list