Commit 2adbdef3 authored by Thomas Guillem's avatar Thomas Guillem

qt: enable audio filters with their name/shortcut

The name of the main module is needed for module_find().
parent d3e1f145
......@@ -899,9 +899,12 @@ void FilterSliderData::writeToConfig()
}
AudioFilterControlWidget::AudioFilterControlWidget
( intf_thread_t *_p_intf, QWidget *parent, const char *_name ) :
QWidget( parent ), p_intf( _p_intf ), name( _name ), i_smallfont(0)
{}
( intf_thread_t *_p_intf, QWidget *parent, const char *_shortcut,
const char *_name = NULL ) :
QWidget( parent ), p_intf( _p_intf ), shortcut( _shortcut ),
name( _name ? _name : _shortcut ), i_smallfont(0)
{
}
void AudioFilterControlWidget::connectConfigChanged( FilterSliderData *slider )
{
......@@ -944,7 +947,7 @@ void AudioFilterControlWidget::build()
char *psz_af = var_InheritString( THEPL, "audio-filter" );
if( psz_af && filterIsPresent( qfu(psz_af), name ) )
if( psz_af && filterIsPresent( qfu(psz_af), shortcut ) )
slidersBox->setChecked( true );
else
slidersBox->setChecked( false );
......@@ -962,10 +965,10 @@ void AudioFilterControlWidget::enable( bool b_enable )
return;
}
QString result = ChangeFiltersString( p_intf, "audio-filter", qtu(name),
QString result = ChangeFiltersString( p_intf, "audio-filter", qtu(shortcut),
b_enable );
emit configChanged( qfu("audio-filter"), result );
playlist_EnableAudioFilter( THEPL, qtu(name), b_enable );
playlist_EnableAudioFilter( THEPL, qtu(shortcut), b_enable );
}
/**********************************************************************
......
......@@ -132,7 +132,8 @@ class AudioFilterControlWidget : public QWidget
Q_OBJECT
public:
AudioFilterControlWidget( intf_thread_t *, QWidget *, const char *name );
AudioFilterControlWidget( intf_thread_t *, QWidget *, const char *shortcut,
const char *name /* = NULL */ );
protected:
virtual void build();
......@@ -141,6 +142,7 @@ protected:
QVector<FilterSliderData *> sliderDatas;
QGroupBox *slidersBox;
intf_thread_t *p_intf;
QString shortcut; // filter's module shorcut name
QString name; // filter's module name
int i_smallfont;
......
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