+ /******************************
+ * VIDEO Panel Implementation *
+ ******************************/
+ START_SPREFS_CAT( Video , qtr("General Video Settings") );
+ CONFIG_GENERIC( "video", Bool, NULL, enableVideo );
+
+ CONFIG_GENERIC( "fullscreen", Bool, NULL, fullscreen );
+ CONFIG_GENERIC( "overlay", Bool, NULL, overlay );
+ CONFIG_GENERIC( "video-on-top", Bool, NULL, alwaysOnTop );
+ CONFIG_GENERIC( "video-deco", Bool, NULL, windowDecorations );
+ CONFIG_GENERIC( "skip-frames" , Bool, NULL, skipFrames );
+ CONFIG_GENERIC( "vout", Module, NULL, outputModule );
+
+#ifdef WIN32
+ CONFIG_GENERIC( "directx-wallpaper" , Bool , NULL, wallpaperMode );
+ CONFIG_GENERIC( "directx-device", StringList, NULL,
+ dXdisplayDevice );
+#else
+ ui.directXBox->setVisible( false );
+#endif
+
+ CONFIG_GENERIC_FILE( "snapshot-path", Directory, NULL,
+ ui.snapshotsDirectory, ui.snapshotsDirectoryBrowse );
+ CONFIG_GENERIC( "snapshot-prefix", String, NULL, snapshotsPrefix );
+ CONFIG_GENERIC( "snapshot-sequential", Bool, NULL,
+ snapshotsSequentialNumbering );
+ CONFIG_GENERIC( "snapshot-format", StringList, NULL,
+ snapshotsFormat );
+ END_SPREFS_CAT;
+
+ /******************************
+ * AUDIO Panel Implementation *
+ ******************************/
+ START_SPREFS_CAT( Audio, qtr("General Audio Settings") );
+
+ CONFIG_GENERIC( "audio", Bool, NULL, enableAudio );
+
+#define audioCommon( name ) \
+ QWidget * name ## Control = new QWidget( ui.outputAudioBox ); \
+ QHBoxLayout * name ## Layout = new QHBoxLayout( name ## Control); \
+ name ## Layout->setMargin( 0 ); \
+ name ## Layout->setSpacing( 0 ); \
+ QLabel * name ## Label = new QLabel( qtr( "Device:" ), name ## Control ); \
+ name ## Label->setMinimumSize(QSize(100, 0)); \
+ name ## Layout->addWidget( name ## Label ); \
+
+#define audioControl( name) \
+ audioCommon( name ) \
+ QComboBox * name ## Device = new QComboBox( name ## Control ); \
+ name ## Layout->addWidget( name ## Device ); \
+ name ## Label->setBuddy( name ## Device ); \
+ outputAudioLayout->addWidget( name ## Control, outputAudioLayout->rowCount(), 0, 1, -1 );
+
+#define audioControl2( name) \
+ audioCommon( name ) \
+ QLineEdit * name ## Device = new QLineEdit( name ## Control ); \
+ name ## Layout->addWidget( name ## Device ); \
+ name ## Label->setBuddy( name ## Device ); \
+ QPushButton * name ## Browse = new QPushButton( qtr( "Browse..." ), name ## Control); \
+ name ## Layout->addWidget( name ## Browse ); \
+ outputAudioLayout->addWidget( name ## Control, outputAudioLayout->rowCount(), 0, 1, -1 );
+
+ /* hide if necessary */
+ ui.lastfm_user_edit->hide();
+ ui.lastfm_user_label->hide();
+ ui.lastfm_pass_edit->hide();
+ ui.lastfm_pass_label->hide();
+
+ /* Build if necessary */
+ QGridLayout * outputAudioLayout = qobject_cast<QGridLayout *>(ui.outputAudioBox->layout());
+#ifdef WIN32
+ audioControl( DirectX );
+ optionWidgets.append( DirectXControl );
+ CONFIG_GENERIC2( "directx-audio-device", IntegerList,
+ DirectXLabel, DirectXDevice );
+#else
+ if( module_Exists( p_intf, "alsa" ) )
+ {
+ audioControl( alsa );
+ optionWidgets.append( alsaControl );
+
+ CONFIG_GENERIC2( "alsadev" , StringList , alsaLabel,
+ alsaDevice );
+ }
+ else
+ optionWidgets.append( NULL );
+ if( module_Exists( p_intf, "oss" ) )
+ {
+ audioControl2( OSS );
+ optionWidgets.append( OSSControl );
+ CONFIG_GENERIC_FILE( "dspdev" , File , OSSLabel, OSSDevice,
+ OSSBrowse );
+ }
+ else
+ optionWidgets.append( NULL );
+#endif
+
+ /* General Audio Options */
+ CONFIG_GENERIC_NO_BOOL( "volume" , IntegerRangeSlider, NULL,
+ defaultVolume );
+ CONNECT( ui.defaultVolume, valueChanged( int ),
+ this, updateAudioVolume( int ) );
+
+ CONFIG_GENERIC( "audio-language" , String , NULL,
+ preferredAudioLanguage );
+
+ CONFIG_GENERIC( "spdif", Bool, NULL, spdifBox );
+ CONFIG_GENERIC( "qt-autosave-volume", Bool, NULL, saveVolBox );
+ CONFIG_GENERIC( "force-dolby-surround" , IntegerList , NULL,
+ detectionDolby );
+
+ CONFIG_GENERIC( "headphone-dolby" , Bool , NULL, headphoneEffect );
+
+ CONFIG_GENERIC_NO_BOOL( "norm-max-level" , Float , NULL,
+ volNormSpin );
+ CONFIG_GENERIC( "audio-visual" , Module , NULL, visualisation);
+
+ /* Audio Output Specifics */
+ CONFIG_GENERIC( "aout", Module, NULL, outputModule );
+
+ CONNECT( ui.outputModule, currentIndexChanged( int ),
+ this, updateAudioOptions( int ) );
+
+ /* File output exists on all platforms */
+ CONFIG_GENERIC_FILE( "audiofile-file" , File , ui.fileLabel,
+ ui.fileName, ui.fileBrowseButton );
+
+ optionWidgets.append( ui.fileControl );
+ optionWidgets.append( ui.outputModule );
+ optionWidgets.append( ui.volNormBox );
+ /*Little mofification of ui.volumeValue to compile with Qt < 4.3 */
+#if HAS_QT43
+ ui.volumeValue->setButtonSymbols(QAbstractSpinBox::NoButtons);
+#endif
+ optionWidgets.append( ui.volumeValue );
+ updateAudioOptions( ui.outputModule->currentIndex() );
+
+ /* LastFM */
+ if( module_Exists( p_intf, "audioscrobbler" ) )
+ {
+ CONFIG_GENERIC( "lastfm-username", String, ui.lastfm_user_label,
+ lastfm_user_edit );
+ CONFIG_GENERIC( "lastfm-password", String, ui.lastfm_pass_label,
+ lastfm_pass_edit );
+
+ if( config_ExistIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ) )
+ ui.lastfm->setChecked( true );
+ else
+ ui.lastfm->setChecked( false );
+ CONNECT( ui.lastfm, stateChanged( int ), this ,
+ lastfm_Changed( int ) );
+ }
+ else
+ ui.lastfm->hide();
+
+ /* Normalizer */
+
+ CONNECT( ui.volNormBox, toggled( bool ), ui.volNormSpin,
+ setEnabled( bool ) );
+ char* psz = config_GetPsz( p_intf, "audio-filter" );
+ qs_filter = qfu( psz );
+ free( psz );
+ bool b_normalizer = ( qs_filter.contains( "volnorm" ) );
+ {
+ ui.volNormBox->setChecked( b_normalizer );
+ ui.volNormSpin->setEnabled( b_normalizer );
+ }
+
+ /* Volume Label */
+ updateAudioVolume( ui.defaultVolume->value() ); // First time init