Commit 35c9f06f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Extended Panels: add callback on audio-presets to fix the issue when the...

Qt4 - Extended Panels: add callback on audio-presets to fix the issue when the audio menu does not match with extended settings.

parent 88e83ca0
...@@ -560,8 +560,8 @@ void ExtVideo::gotoConf( QObject* src ) ...@@ -560,8 +560,8 @@ void ExtVideo::gotoConf( QObject* src )
static const QString band_frequencies[] = static const QString band_frequencies[] =
{ {
" 60Hz ", " 170 Hz " , " 310 Hz ", " 600 Hz ", " 1 kHz ", " 60 Hz ", " 170 Hz ", " 310 Hz ", " 600 Hz ", " 1 kHz ",
" 3 kHz " , " 6 kHz ", " 12 kHz ", " 14 kHz ", " 16 kHz " " 3 kHz ", " 6 kHz ", " 12 kHz ", " 14 kHz ", " 16 kHz "
}; };
Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) : Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
...@@ -571,6 +571,7 @@ Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -571,6 +571,7 @@ Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
smallFont.setPointSize( smallFont.pointSize() - 3 ); smallFont.setPointSize( smallFont.pointSize() - 3 );
ui.setupUi( this ); ui.setupUi( this );
presetsComboBox = ui.presetsCombo;
ui.preampLabel->setFont( smallFont ); ui.preampLabel->setFont( smallFont );
ui.preampSlider->setMaximum( 400 ); ui.preampSlider->setMaximum( 400 );
...@@ -772,19 +773,29 @@ void Equalizer::setPreset( int preset ) ...@@ -772,19 +773,29 @@ void Equalizer::setPreset( int preset )
setValues( psz_values, eqz_preset_10b[preset]->f_preamp ); setValues( psz_values, eqz_preset_10b[preset]->f_preamp );
} }
static int PresetCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
char *psz_preset = newval.psz_string;
Equalizer *eq = (Equalizer *)p_data;
eq->presetsComboBox->setCurrentIndex( eq->presetsComboBox->findText( qfu( psz_preset) ) );
return VLC_SUCCESS;
}
void Equalizer::delCallbacks( aout_instance_t *p_aout ) void Equalizer::delCallbacks( aout_instance_t *p_aout )
{ {
// var_DelCallback( p_aout, "equalizer-bands", EqzCallback, this ); //var_DelCallback( p_aout, "equalizer-bands", EqzCallback, this );
// var_DelCallback( p_aout, "equalizer-preamp", EqzCallback, this ); //var_DelCallback( p_aout, "equalizer-preamp", EqzCallback, this );
var_DelCallback( p_aout, "equalizer-preset", PresetCallback, this );
} }
void Equalizer::addCallbacks( aout_instance_t *p_aout ) void Equalizer::addCallbacks( aout_instance_t *p_aout )
{ {
// var_AddCallback( p_aout, "equalizer-bands", EqzCallback, this ); //var_AddCallback( p_aout, "equalizer-bands", EqzCallback, this );
// var_AddCallback( p_aout, "equalizer-preamp", EqzCallback, this ); //var_AddCallback( p_aout, "equalizer-preamp", EqzCallback, this );
var_AddCallback( p_aout, "equalizer-preset", PresetCallback, this );
} }
/********************************************************************** /**********************************************************************
* Spatializer * Spatializer
**********************************************************************/ **********************************************************************/
......
...@@ -61,6 +61,7 @@ class Equalizer: public QWidget ...@@ -61,6 +61,7 @@ class Equalizer: public QWidget
public: public:
Equalizer( intf_thread_t *, QWidget * ); Equalizer( intf_thread_t *, QWidget * );
virtual ~Equalizer(); virtual ~Equalizer();
QComboBox *presetsComboBox;
private: private:
Ui::EqualizerWidget ui; Ui::EqualizerWidget ui;
......
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