controls.append( control ); \
}
+#define CONFIG_GENERIC2( option, type, label, qcontrol ) \
+ p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
+ if( p_config ) \
+ { \
+ control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
+ p_config, label, qcontrol, false ); \
+ controls.append( control ); \
+ }
+
+
#define CONFIG_GENERIC_NO_BOOL( option, type, label, qcontrol ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
if( p_config ) \
if( p_config ) \
{ \
control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
- p_config, label, ui.qcontrol, ui.qbutton, \
+ p_config, label, qcontrol, qbutton, \
false ); \
controls.append( control ); \
}
#endif
CONFIG_GENERIC_FILE( "snapshot-path", Directory, NULL,
- snapshotsDirectory, snapshotsDirectoryBrowse );
+ ui.snapshotsDirectory, ui.snapshotsDirectoryBrowse );
CONFIG_GENERIC( "snapshot-prefix", String, NULL, snapshotsPrefix );
CONFIG_GENERIC( "snapshot-sequential", Bool, NULL,
snapshotsSequentialNumbering );
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 ); \
+ ui.outputAudioLayout->addWidget( name ## Control, ui.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 ); \
+ ui.outputAudioLayout->addWidget( name ## Control, ui.outputAudioLayout->rowCount(), 0, 1, -1 );
+
/* hide if necessary */
-#ifdef WIN32
- ui.OSSControl->hide();
- ui.alsaControl->hide();
-#else
- ui.DirectXControl->hide();
-#endif
ui.lastfm_user_edit->hide();
ui.lastfm_user_label->hide();
ui.lastfm_pass_edit->hide();
ui.lastfm_pass_label->hide();
+ /* Build if necessary */
+#ifdef WIN32
+ audioControl( DirectX );
+ optionWidgets.append( DirectXControl );
+#else
+ audioControl( alsa );
+ optionWidgets.append( alsaControl );
+ audioControl2( OSS );
+ optionWidgets.append( OSSControl );
+#endif
+
/* General Audio Options */
CONFIG_GENERIC_NO_BOOL( "volume" , IntegerRangeSlider, NULL,
defaultVolume );
CONNECT( ui.outputModule, currentIndexChanged( int ),
this, updateAudioOptions( int ) );
+ /* platform specifics */
#ifdef WIN32
- CONFIG_GENERIC( "directx-audio-device", IntegerList,
- ui.DirectXLabel, DirectXDevice );
+ CONFIG_GENERIC2( "directx-audio-device", IntegerList,
+ DirectXLabel, DirectXDevice );
#else
if( module_Exists( p_intf, "alsa" ) )
{
- CONFIG_GENERIC( "alsadev" , StringList , ui.alsaLabel,
+ CONFIG_GENERIC2( "alsadev" , StringList , alsaLabel,
alsaDevice );
}
if( module_Exists( p_intf, "oss" ) )
{
- CONFIG_GENERIC_FILE( "dspdev" , File , ui.OSSLabel, OSSDevice,
+ CONFIG_GENERIC_FILE( "dspdev" , File , OSSLabel, OSSDevice,
OSSBrowse );
}
#endif
// File exists everywhere
CONFIG_GENERIC_FILE( "audiofile-file" , File , ui.fileLabel,
- fileName, fileBrowseButton );
+ ui.fileName, ui.fileBrowseButton );
- optionWidgets.append( ui.alsaControl );
- optionWidgets.append( ui.OSSControl );
- optionWidgets.append( ui.DirectXControl );
optionWidgets.append( ui.fileControl );
optionWidgets.append( ui.outputModule );
optionWidgets.append( ui.volNormBox );
CONFIG_GENERIC( "qt-display-mode", IntegerList, NULL,
displayModeBox );
CONFIG_GENERIC( "embedded-video", Bool, NULL, embedVideo );
- CONFIG_GENERIC_FILE( "skins2-last", File, NULL, fileSkin,
- skinBrowse );
+ CONFIG_GENERIC_FILE( "skins2-last", File, NULL, ui.fileSkin,
+ ui.skinBrowse );
CONFIG_GENERIC( "album-art", IntegerList, ui.artFetchLabel,
artFetcher );
CONFIG_GENERIC( "subsdec-encoding", StringList, NULL, encoding );
CONFIG_GENERIC( "sub-language", String, NULL, preferredLanguage );
- CONFIG_GENERIC_FILE( "freetype-font", File, NULL, font,
- fontBrowse );
+ CONFIG_GENERIC_FILE( "freetype-font", File, NULL, ui.font,
+ ui.fontBrowse );
CONFIG_GENERIC( "freetype-color", IntegerList, NULL, fontColor );
CONFIG_GENERIC( "freetype-rel-fontsize", IntegerList, NULL,
fontSize );
{
QString value = qobject_cast<QComboBox *>(optionWidgets[audioOutCoB])
->itemData( number ).toString();
-
#ifdef WIN32
optionWidgets[directxW]->setVisible( ( value == "directx" ) );
#else
<rect>
<x>0</x>
<y>0</y>
- <width>550</width>
- <height>732</height>
+ <width>541</width>
+ <height>607</height>
</rect>
</property>
<property name="windowTitle" >
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_3" >
+ <widget class="QGroupBox" name="audioBox" >
<property name="title" >
<string>_("General Audio")</string>
</property>
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_2" >
+ <widget class="QGroupBox" name="outputAudioBox" >
<property name="title" >
<string>Output</string>
</property>
- <layout class="QGridLayout" >
+ <layout class="QGridLayout" name="outputAudioLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="minimumSize" >
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="outputModule" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
</widget>
</item>
<item row="1" column="0" colspan="2" >
- <widget class="QWidget" native="1" name="alsaControl" >
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="alsaLabel" >
- <property name="minimumSize" >
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>_("Device")</string>
- </property>
- <property name="buddy" >
- <cstring>alsaDevice</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="alsaDevice" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="2" >
- <widget class="QWidget" native="1" name="DirectXControl" >
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="DirectXLabel" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>_("Device")</string>
- </property>
- <property name="buddy" >
- <cstring>DirectXDevice</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="DirectXDevice" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0" colspan="2" >
- <widget class="QWidget" native="1" name="OSSControl" >
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="OSSLabel" >
- <property name="minimumSize" >
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>_("Device")</string>
- </property>
- <property name="buddy" >
- <cstring>OSSDevice</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="OSSDevice" />
- </item>
- <item>
- <widget class="QPushButton" name="OSSBrowse" >
- <property name="text" >
- <string>_("Browse...")</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0" colspan="2" >
<widget class="QWidget" native="1" name="fileControl" >
<layout class="QHBoxLayout" >
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
<widget class="QLabel" name="fileLabel" >
<property name="minimumSize" >
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_4" >
+ <widget class="QGroupBox" name="lastFMBox" >
<property name="title" >
<string>_("Last.fm")</string>
</property>
<tabstop>detectionDolby</tabstop>
<tabstop>preferredAudioLanguage</tabstop>
<tabstop>outputModule</tabstop>
- <tabstop>alsaDevice</tabstop>
- <tabstop>DirectXDevice</tabstop>
- <tabstop>OSSDevice</tabstop>
- <tabstop>OSSBrowse</tabstop>
<tabstop>fileName</tabstop>
<tabstop>fileBrowseButton</tabstop>
<tabstop>headphoneEffect</tabstop>