]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/extended_panels.hpp
Qt: Add control to the compressor module
[vlc] / modules / gui / qt4 / components / extended_panels.hpp
1 /*****************************************************************************
2  * extended_panels.hpp : Exentended Panels
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Antoine Cellerier <dionoea at videolan dot org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef _EQUALIZER_H_
26 #define _EQUALIZER_H_
27
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31
32 #include <vlc_common.h>
33
34 #include "ui/equalizer.h"
35 #include "ui/video_effects.h"
36 #include "ui/v4l2.h"
37
38 #include <QTabWidget>
39
40 #define BANDS 10
41 #define NUM_CP_CTRL 7
42 #define NUM_SP_CTRL 5
43
44 class QSignalMapper;
45
46 class ExtVideo: public QObject
47 {
48     Q_OBJECT
49     friend class ExtendedDialog;
50 public:
51     ExtVideo( struct intf_thread_t *, QTabWidget * );
52     virtual ~ExtVideo();
53     /*void gotoConf( QObject* );*/
54 private:
55     Ui::ExtVideoWidget ui;
56     QSignalMapper* filterMapper;
57     intf_thread_t *p_intf;
58     vout_thread_t *p_vout;
59     void initComboBoxItems( QObject* );
60     void setWidgetValue( QObject* );
61     void ChangeVFiltersString( const char *psz_name, bool b_add );
62     void clean();
63 private slots:
64     void updateFilters();
65     void updateFilterOptions();
66     void cropChange();
67 };
68
69 class ExtV4l2 : public QWidget
70 {
71     Q_OBJECT
72 public:
73     ExtV4l2( intf_thread_t *, QWidget * );
74     virtual ~ExtV4l2();
75
76     virtual void showEvent( QShowEvent *event );
77
78 private:
79     intf_thread_t *p_intf;
80     Ui::ExtV4l2Widget ui;
81     QGroupBox *box;
82
83 private slots:
84     void Refresh( void );
85     void ValueChange( int value );
86     void ValueChange( bool value );
87 };
88
89 class Equalizer: public QWidget
90 {
91     Q_OBJECT
92     friend class ExtendedDialog;
93 public:
94     Equalizer( intf_thread_t *, QWidget * );
95     virtual ~Equalizer();
96     QComboBox *presetsComboBox;
97
98     char * createValuesFromPreset( int i_preset );
99     void updateUIFromCore();
100 private:
101     Ui::EqualizerWidget ui;
102     QSlider *bands[BANDS];
103     QLabel *band_texts[BANDS];
104
105     void delCallbacks( aout_instance_t * );
106     void addCallbacks( aout_instance_t * );
107
108     intf_thread_t *p_intf;
109     void clean();
110 private slots:
111     void enable(bool);
112     void enable();
113     void set2Pass();
114     void setPreamp();
115     void setCoreBands();
116     void setCorePreset(int);
117 };
118
119 class Compressor: public QWidget
120 {
121     Q_OBJECT
122 public:
123     Compressor( intf_thread_t *, QWidget * );
124
125 private:
126     QSlider *compCtrl[NUM_CP_CTRL];
127     QLabel *ctrl_texts[NUM_CP_CTRL];
128     QLabel *ctrl_readout[NUM_CP_CTRL];
129     float controlVars[NUM_CP_CTRL];
130     float oldControlVars[NUM_CP_CTRL];
131
132     QCheckBox *enableCheck;
133
134     void delCallbacks( aout_instance_t * );
135     void addCallbacks( aout_instance_t * );
136     intf_thread_t *p_intf;
137 private slots:
138     void enable(bool);
139     void enable();
140     void updateSliders(float *);
141     void setValues(float *);
142     void setInitValues();
143 };
144
145 class Spatializer: public QWidget
146 {
147     Q_OBJECT
148 public:
149     Spatializer( intf_thread_t *, QWidget * );
150     virtual ~Spatializer();
151
152 private:
153     QSlider *spatCtrl[NUM_SP_CTRL];
154     QLabel *ctrl_texts[NUM_SP_CTRL];
155     QLabel *ctrl_readout[NUM_SP_CTRL];
156     float controlVars[5];
157     float oldControlVars[5];
158
159     QCheckBox *enableCheck;
160
161     void delCallbacks( aout_instance_t * );
162     void addCallbacks( aout_instance_t * );
163     intf_thread_t *p_intf;
164 private slots:
165     void enable(bool);
166     void enable();
167     void setValues(float *);
168     void setInitValues();
169 };
170
171 class SyncControls : public QWidget
172 {
173     Q_OBJECT
174     friend class ExtendedDialog;
175 public:
176     SyncControls( intf_thread_t *, QWidget * );
177     virtual ~SyncControls() {};
178 private:
179     intf_thread_t *p_intf;
180     QDoubleSpinBox *AVSpin;
181     QDoubleSpinBox *subsSpin;
182     QDoubleSpinBox *subSpeedSpin;
183
184     bool b_userAction;
185
186     void clean();
187 public slots:
188     void update();
189 private slots:
190     void advanceAudio( double );
191     void advanceSubs( double );
192     void adjustSubsSpeed( double );
193 };
194
195 #endif