Commit cacd39b8 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Preferences, audio, save the normalizer activation and clean.

parent ad9ca44d
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
* - Finish implementation (see WX) * - Finish implementation (see WX)
* - Improvements over WX * - Improvements over WX
* - Validator for modulelist * - Validator for modulelist
* - Implement update stuff using a general Updated signal
*/ */
#include "components/preferences_widgets.hpp" #include "components/preferences_widgets.hpp"
...@@ -685,7 +684,6 @@ void ModuleListConfigControl::onUpdate( int value ) ...@@ -685,7 +684,6 @@ void ModuleListConfigControl::onUpdate( int value )
} }
} }
} }
emit Updated();
} }
/************************************************************************** /**************************************************************************
......
...@@ -85,8 +85,11 @@ protected: ...@@ -85,8 +85,11 @@ protected:
QString _name; QString _name;
QWidget *widget; QWidget *widget;
bool _advanced; bool _advanced;
#if 0
/* You shouldn't use that now..*/
signals: signals:
void Updated(); void Updated();
#endif
}; };
/******************************************************* /*******************************************************
......
...@@ -215,9 +215,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -215,9 +215,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
detectionDolby ); detectionDolby );
CONFIG_GENERIC( "headphone-dolby" , Bool , NULL, headphoneEffect ); CONFIG_GENERIC( "headphone-dolby" , Bool , NULL, headphoneEffect );
// CONFIG_GENERIC( "" , Bool, NULL, ); activation of normalizer //FIXME
CONFIG_GENERIC_NO_BOOL( "norm-max-level" , Float , NULL, CONFIG_GENERIC_NO_BOOL( "norm-max-level" , Float , NULL,
volNormalizer ); volNormSpin );
CONFIG_GENERIC( "audio-visual" , Module , NULL, visualisation); CONFIG_GENERIC( "audio-visual" , Module , NULL, visualisation);
/* Audio Output Specifics */ /* Audio Output Specifics */
...@@ -271,6 +271,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -271,6 +271,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONNECT( ui.lastfm, stateChanged( int ), this , CONNECT( ui.lastfm, stateChanged( int ), this ,
lastfm_Changed( int ) ); lastfm_Changed( int ) );
/* Normalizer */
normalizerBox = ui.volNormBox;
CONNECT( ui.volNormBox, toggled( bool ), ui.volNormSpin, setEnabled( bool ) );
qs_filter = qfu( config_GetPsz( p_intf, "audio-filter" ) );
bool b_normalizer = ( qs_filter.contains( "volnorm" ) );
{
ui.volNormBox->setChecked( b_normalizer );
ui.volNormSpin->setEnabled( b_normalizer );
}
END_SPREFS_CAT; END_SPREFS_CAT;
/* Input and Codecs Panel Implementation */ /* Input and Codecs Panel Implementation */
...@@ -297,7 +307,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -297,7 +307,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort ); CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort );
CONFIG_GENERIC( "http-proxy", String , NULL, proxy ); CONFIG_GENERIC( "http-proxy", String , NULL, proxy );
/* Caching */ /* Caching */
/* CONFIG_GENERIC( );*/ //FIXME /* CONFIG_GENERIC( );*/ //FIXME
...@@ -327,14 +337,14 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -327,14 +337,14 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#endif #endif
/* interface */ /* interface */
p_config = config_FindConfig( VLC_OBJECT(p_intf), "intf" ); char *psz_intf = config_GetPsz( p_intf, "intf" );
if( p_config->value.psz && strcmp( p_config->value.psz, "qt4" )) if( psz_intf )
{ {
ui.qt4->setChecked( true ); msg_Dbg( p_intf, "Interface in config file: %s", psz_intf );
} if( strstr( psz_intf, "skin" ) )
if( p_config->value.psz && strcmp( p_config->value.psz, "skins2" )) ui.skins->setChecked( true );
{ else if( strstr( psz_intf, "qt" ) )
ui.skins->setChecked( true ); ui.qt4->setChecked( true );
} }
skinInterfaceButton = ui.skins; skinInterfaceButton = ui.skins;
qtInterfaceButton = ui.qt4; qtInterfaceButton = ui.qt4;
...@@ -435,6 +445,33 @@ void SPrefsPanel::apply() ...@@ -435,6 +445,33 @@ void SPrefsPanel::apply()
if( qtInterfaceButton->isChecked() ) if( qtInterfaceButton->isChecked() )
config_PutPsz( p_intf, "intf", "qt4" ); config_PutPsz( p_intf, "intf", "qt4" );
} }
if( number == SPrefsAudio )
{
bool b_normChecked = normalizerBox->isChecked();
if( qs_filter.isEmpty() )
{
/* the psz_filter is already empty, so we just append it needed */
if( b_normChecked ) qs_filter = "volnorm";
}
else /* Not Empty */
{
if( qs_filter.contains( "volnorm" ) )
{
/* The qs_filter not empty and contains "volnorm" that we have to remove */
if( !b_normChecked )
{
/* Ugly :D */
qs_filter.remove( "volnorm:" );
qs_filter.remove( ":volnorm" );
qs_filter.remove( "volnorm" );
}
}
else /* qs_filter not empty, but doesn't have volnorm inside already */
if( b_normChecked ) qs_filter.append( ":volnorm" );
}
config_PutPsz( p_intf, "audio-filter", qtu( qs_filter ) );
}
} }
void SPrefsPanel::clean() void SPrefsPanel::clean()
......
...@@ -43,6 +43,8 @@ class ConfigControl; ...@@ -43,6 +43,8 @@ class ConfigControl;
class QComboBox; class QComboBox;
class QLineEdit; class QLineEdit;
class QRadioButton; class QRadioButton;
class QCheckBox;
class QString;
class SPrefsCatList : public QWidget class SPrefsCatList : public QWidget
{ {
...@@ -72,6 +74,7 @@ private: ...@@ -72,6 +74,7 @@ private:
int number; int number;
/* this is ugly and bad until I found a new solution */
QWidget *alsa_options; QWidget *alsa_options;
QWidget *oss_options; QWidget *oss_options;
QWidget *directx_options; QWidget *directx_options;
...@@ -80,6 +83,8 @@ private: ...@@ -80,6 +83,8 @@ private:
QLineEdit *inputDevice; QLineEdit *inputDevice;
QRadioButton *skinInterfaceButton; QRadioButton *skinInterfaceButton;
QRadioButton *qtInterfaceButton; QRadioButton *qtInterfaceButton;
QString qs_filter;
QCheckBox *normalizerBox;
/* Display only the options for the selected audio output */ /* Display only the options for the selected audio output */
private slots: private slots:
......
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QCheckBox" name="volumeNormalizer" > <widget class="QCheckBox" name="volNormBox" >
<property name="text" > <property name="text" >
<string>_("Volume normalizer")</string> <string>_("Volume normalizer")</string>
</property> </property>
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="1" column="1" >
<widget class="QDoubleSpinBox" name="volNormalizer" > <widget class="QDoubleSpinBox" name="volNormSpin" >
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight</set> <set>Qt::AlignRight</set>
</property> </property>
...@@ -333,8 +333,8 @@ ...@@ -333,8 +333,8 @@
<tabstop>OSSBrowse</tabstop> <tabstop>OSSBrowse</tabstop>
<tabstop>fileBrowseButton</tabstop> <tabstop>fileBrowseButton</tabstop>
<tabstop>headphoneEffect</tabstop> <tabstop>headphoneEffect</tabstop>
<tabstop>volumeNormalizer</tabstop> <tabstop>volNormBox</tabstop>
<tabstop>volNormalizer</tabstop> <tabstop>volNormSpin</tabstop>
<tabstop>visualisation</tabstop> <tabstop>visualisation</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
......
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