]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/extended_panels.hpp
Qt: extended panels, code simplification and spatializer slider naming
[vlc] / modules / gui / qt4 / components / extended_panels.hpp
index 3d8bb637b5238283a0607a160f435e8df9b04e2e..c7b751d1f592a54424f45d76956f19f2c7e178af 100644 (file)
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
-#include <vlc_aout.h>
+#include <vlc_common.h>
 
 #include "ui/equalizer.h"
 #include "ui/video_effects.h"
 #include "ui/v4l2.h"
 
 #include <QTabWidget>
+
 #define BANDS 10
+#define NUM_CP_CTRL 7
 #define NUM_SP_CTRL 5
 
 class QSignalMapper;
@@ -45,8 +46,9 @@ class QSignalMapper;
 class ExtVideo: public QObject
 {
     Q_OBJECT
+    friend class ExtendedDialog;
 public:
-    ExtVideo( intf_thread_t *, QTabWidget * );
+    ExtVideo( struct intf_thread_t *, QTabWidget * );
     virtual ~ExtVideo();
     /*void gotoConf( QObject* );*/
 private:
@@ -56,7 +58,8 @@ private:
     vout_thread_t *p_vout;
     void initComboBoxItems( QObject* );
     void setWidgetValue( QObject* );
-    void ChangeVFiltersString( char *psz_name, bool b_add );
+    void ChangeVFiltersString( const char *psz_name, bool b_add );
+    void clean();
 private slots:
     void updateFilters();
     void updateFilterOptions();
@@ -86,11 +89,13 @@ private slots:
 class Equalizer: public QWidget
 {
     Q_OBJECT
+    friend class ExtendedDialog;
 public:
     Equalizer( intf_thread_t *, QWidget * );
-    virtual ~Equalizer();
     QComboBox *presetsComboBox;
 
+    char * createValuesFromPreset( int i_preset );
+    void updateUIFromCore();
 private:
     Ui::EqualizerWidget ui;
     QSlider *bands[BANDS];
@@ -98,63 +103,78 @@ private:
 
     void delCallbacks( aout_instance_t * );
     void addCallbacks( aout_instance_t * );
-    void setValues( char *, float );
 
     intf_thread_t *p_intf;
+    void clean() { enable(); }
 private slots:
     void enable(bool);
     void enable();
     void set2Pass();
     void setPreamp();
-    void setBand();
-    void setPreset(int);
+    void setCoreBands();
+    void setCorePreset(int);
 };
 
-class Spatializer: public QWidget
+class Compressor: public QWidget
 {
     Q_OBJECT
 public:
-    Spatializer( intf_thread_t *, QWidget * );
-    virtual ~Spatializer();
+    Compressor( intf_thread_t *, QWidget * );
 
 private:
-    QSlider *spatCtrl[NUM_SP_CTRL];
-    QLabel *ctrl_texts[NUM_SP_CTRL];
-    QLabel *ctrl_readout[NUM_SP_CTRL];
-    float controlVars[5];
-    float oldControlVars[5];
+    QSlider *compCtrl[NUM_CP_CTRL];
+    QLabel *ctrl_texts[NUM_CP_CTRL];
+    QLabel *ctrl_readout[NUM_CP_CTRL];
+    float controlVars[NUM_CP_CTRL];
+    float oldControlVars[NUM_CP_CTRL];
 
     QCheckBox *enableCheck;
 
+    intf_thread_t *p_intf;
+
     void delCallbacks( aout_instance_t * );
     void addCallbacks( aout_instance_t * );
-    intf_thread_t *p_intf;
+
+    void updateSliders(float *);
+    void setValues(float *);
+
 private slots:
     void enable(bool);
     void enable();
-    void setValues(float *);
     void setInitValues();
 };
 
-class ExtendedControls: public QWidget
+class Spatializer: public QWidget
 {
     Q_OBJECT
 public:
-    ExtendedControls( intf_thread_t *, QWidget * ) {};
-    virtual ~ExtendedControls() {};
+    Spatializer( intf_thread_t *, QWidget * );
 
 private:
+    QSlider *spatCtrl[NUM_SP_CTRL];
+    QLabel *ctrl_texts[NUM_SP_CTRL];
+    QLabel *ctrl_readout[NUM_SP_CTRL];
+    float controlVars[5];
+    float oldControlVars[5];
+
+    QCheckBox *enableCheck;
+
+    void delCallbacks( aout_instance_t * );
+    void addCallbacks( aout_instance_t * );
     intf_thread_t *p_intf;
+
+    void setValues(float *);
+
 private slots:
-    void slower() {};
-    void faster() {};
-    void normal() {};
-    void snapshot() {};
+    void enable(bool);
+    void enable();
+    void setInitValues();
 };
 
 class SyncControls : public QWidget
 {
     Q_OBJECT
+    friend class ExtendedDialog;
 public:
     SyncControls( intf_thread_t *, QWidget * );
     virtual ~SyncControls() {};
@@ -163,6 +183,10 @@ private:
     QDoubleSpinBox *AVSpin;
     QDoubleSpinBox *subsSpin;
     QDoubleSpinBox *subSpeedSpin;
+
+    bool b_userAction;
+
+    void clean();
 public slots:
     void update();
 private slots: