Commit 0d2b87a9 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Code factorization.

parent c67627c6
...@@ -246,11 +246,28 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -246,11 +246,28 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#ifdef WIN32 #ifdef WIN32
audioControl( DirectX ); audioControl( DirectX );
optionWidgets.append( DirectXControl ); optionWidgets.append( DirectXControl );
CONFIG_GENERIC2( "directx-audio-device", IntegerList,
DirectXLabel, DirectXDevice );
#else #else
audioControl( alsa ); if( module_Exists( p_intf, "alsa" ) )
optionWidgets.append( alsaControl ); {
audioControl2( OSS ); audioControl( alsa );
optionWidgets.append( OSSControl ); 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 #endif
/* General Audio Options */ /* General Audio Options */
...@@ -279,23 +296,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -279,23 +296,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONNECT( ui.outputModule, currentIndexChanged( int ), CONNECT( ui.outputModule, currentIndexChanged( int ),
this, updateAudioOptions( int ) ); this, updateAudioOptions( int ) );
/* platform specifics */ // File exists everywhere
#ifdef WIN32
CONFIG_GENERIC2( "directx-audio-device", IntegerList,
DirectXLabel, DirectXDevice );
#else
if( module_Exists( p_intf, "alsa" ) )
{
CONFIG_GENERIC2( "alsadev" , StringList , alsaLabel,
alsaDevice );
}
if( module_Exists( p_intf, "oss" ) )
{
CONFIG_GENERIC_FILE( "dspdev" , File , OSSLabel, OSSDevice,
OSSBrowse );
}
#endif
// File exists everywhere
CONFIG_GENERIC_FILE( "audiofile-file" , File , ui.fileLabel, CONFIG_GENERIC_FILE( "audiofile-file" , File , ui.fileLabel,
ui.fileName, ui.fileBrowseButton ); ui.fileName, ui.fileBrowseButton );
...@@ -551,8 +552,12 @@ void SPrefsPanel::updateAudioOptions( int number) ...@@ -551,8 +552,12 @@ void SPrefsPanel::updateAudioOptions( int number)
#ifdef WIN32 #ifdef WIN32
optionWidgets[directxW]->setVisible( ( value == "directx" ) ); optionWidgets[directxW]->setVisible( ( value == "directx" ) );
#else #else
optionWidgets[ossW]->setVisible( ( value == "oss" ) ); /* optionWidgets[ossW] can be NULL */
optionWidgets[alsaW]->setVisible( ( value == "alsa" ) ); if( optionWidgets[ossW] )
optionWidgets[ossW]->setVisible( ( value == "oss" ) );
/* optionWidgets[alsaW] can be NULL */
if( optionWidgets[alsaW] )
optionWidgets[alsaW]->setVisible( ( value == "alsa" ) );
#endif #endif
optionWidgets[fileW]->setVisible( ( value == "aout_file" ) ); optionWidgets[fileW]->setVisible( ( value == "aout_file" ) );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment