Commit a300dcc8 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: Equalizer: rework (fix #7923)

parent a52e23c7
...@@ -104,19 +104,18 @@ public: ...@@ -104,19 +104,18 @@ public:
void setValue( float f ); void setValue( float f );
protected: protected:
float initialValue(); FilterSliderData( QObject *parent, QSlider *slider );
virtual float initialValue();
public slots:
void onValueChanged( int i );
void updateText( int i );
void writeToConfig();
private:
intf_thread_t *p_intf;
QSlider *slider; QSlider *slider;
QLabel *valueLabel; QLabel *valueLabel;
QLabel *nameLabel; QLabel *nameLabel;
const slider_data_t *p_data; const slider_data_t *p_data;
intf_thread_t *p_intf;
public slots:
virtual void onValueChanged( int i ) const;
virtual void updateText( int i );
virtual void writeToConfig() const;
}; };
class AudioFilterControlWidget : public QWidget class AudioFilterControlWidget : public QWidget
...@@ -136,38 +135,47 @@ protected: ...@@ -136,38 +135,47 @@ protected:
int i_smallfont; int i_smallfont;
protected slots: protected slots:
void enable(); void enable( bool ) const;
}; };
class Equalizer: public QWidget class EqualizerSliderData : public FilterSliderData
{ {
Q_OBJECT Q_OBJECT
friend class ExtendedDialog;
public:
EqualizerSliderData( QObject *parent, intf_thread_t *p_intf,
QSlider *slider,
QLabel *valueLabel, QLabel *nameLabel,
const slider_data_t *p_data, int index );
protected:
virtual float initialValue();
int index;
QStringList getBandsFromAout() const;
public slots:
virtual void onValueChanged( int i ) const;
virtual void writeToConfig() const;
};
class Equalizer: public AudioFilterControlWidget
{
Q_OBJECT
public: public:
Equalizer( intf_thread_t *, QWidget * ); Equalizer( intf_thread_t *, QWidget * );
QComboBox *presetsComboBox;
char * createValuesFromPreset( int i_preset ); protected:
void updateUIFromCore(); virtual void build();
void changeFreqLabels( bool );
private:
Ui::EqualizerWidget ui;
QSlider *bands[BANDS];
QLabel *band_texts[BANDS];
bool b_vlcBands;
void delCallbacks( vlc_object_t * ); private:
void addCallbacks( vlc_object_t * ); QVector<FilterSliderData *> eqSliders;
FilterSliderData *preamp;
FilterSliderData::slider_data_t preamp_values;
intf_thread_t *p_intf;
void clean() { enable(); }
private slots: private slots:
void enable(bool); void setCorePreset( int );
void enable(); void enable2Pass( bool ) const;
void set2Pass();
void setPreamp();
void setCoreBands();
void setCorePreset(int);
}; };
class Compressor: public AudioFilterControlWidget class Compressor: public AudioFilterControlWidget
......
...@@ -136,5 +136,4 @@ void ExtendedDialog::changedItem( int i_status ) ...@@ -136,5 +136,4 @@ void ExtendedDialog::changedItem( int i_status )
if( i_status != END_S ) return; if( i_status != END_S ) return;
syncW->clean(); syncW->clean();
videoEffect->clean(); videoEffect->clean();
equal->clean();
} }
...@@ -19,7 +19,16 @@ ...@@ -19,7 +19,16 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
...@@ -87,7 +96,7 @@ ...@@ -87,7 +96,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2"> <item row="3" column="0" colspan="2">
<widget class="QLabel" name="preampLabel"> <widget class="QLabel" name="preampLabel">
<property name="text"> <property name="text">
<string>Preamp</string> <string>Preamp</string>
...@@ -113,7 +122,7 @@ ...@@ -113,7 +122,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="2" rowspan="2"> <item row="1" column="2" rowspan="4">
<widget class="QWidget" name="slidersPlaceholder" native="true"> <widget class="QWidget" name="slidersPlaceholder" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
...@@ -123,6 +132,13 @@ ...@@ -123,6 +132,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="preampValue">
<property name="text">
<string>0.00 dB</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
......
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