]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/extended_panels.hpp
Qt: adv settings: Optimize synchronization panel
[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
37 #include <QTabWidget>
38
39 #define BANDS 10
40 #define NUM_CP_CTRL 7
41 #define NUM_SP_CTRL 5
42
43 class QSignalMapper;
44
45 class ExtVideo: public QObject
46 {
47     Q_OBJECT
48     friend class ExtendedDialog;
49 public:
50     ExtVideo( struct intf_thread_t *, QTabWidget * );
51     /*void gotoConf( QObject* );*/
52 private:
53     Ui::ExtVideoWidget ui;
54     QSignalMapper* filterMapper;
55     intf_thread_t *p_intf;
56     void initComboBoxItems( QObject* );
57     void setWidgetValue( QObject* );
58     void clean();
59 private slots:
60     void updateFilters();
61     void updateFilterOptions();
62     void cropChange();
63     void browseLogo();
64     void browseEraseFile();
65 };
66
67 class ExtV4l2 : public QWidget
68 {
69     Q_OBJECT
70 public:
71     ExtV4l2( intf_thread_t *, QWidget * );
72
73     virtual void showEvent( QShowEvent *event );
74
75 private:
76     intf_thread_t *p_intf;
77     QGroupBox *box;
78     QLabel *help;
79
80 private slots:
81     void Refresh( void );
82     void ValueChange( int value );
83     void ValueChange( bool value );
84 };
85
86 class Equalizer: public QWidget
87 {
88     Q_OBJECT
89     friend class ExtendedDialog;
90 public:
91     Equalizer( intf_thread_t *, QWidget * );
92     QComboBox *presetsComboBox;
93
94     char * createValuesFromPreset( int i_preset );
95     void updateUIFromCore();
96 private:
97     Ui::EqualizerWidget ui;
98     QSlider *bands[BANDS];
99     QLabel *band_texts[BANDS];
100
101     void delCallbacks( vlc_object_t * );
102     void addCallbacks( vlc_object_t * );
103
104     intf_thread_t *p_intf;
105     void clean() { enable(); }
106 private slots:
107     void enable(bool);
108     void enable();
109     void set2Pass();
110     void setPreamp();
111     void setCoreBands();
112     void setCorePreset(int);
113 };
114
115 class Compressor: public QWidget
116 {
117     Q_OBJECT
118 public:
119     Compressor( intf_thread_t *, QWidget * );
120
121 private:
122     QSlider *compCtrl[NUM_CP_CTRL];
123     QLabel *ctrl_texts[NUM_CP_CTRL];
124     QLabel *ctrl_readout[NUM_CP_CTRL];
125     float controlVars[NUM_CP_CTRL];
126     float oldControlVars[NUM_CP_CTRL];
127
128     QCheckBox *enableCheck;
129
130     intf_thread_t *p_intf;
131
132     void delCallbacks( vlc_object_t * );
133     void addCallbacks( vlc_object_t * );
134
135     void updateSliders(float *);
136     void setValues();
137
138 private slots:
139     void enable(bool);
140     void enable();
141     void setInitValues();
142 };
143
144 class Spatializer: public QWidget
145 {
146     Q_OBJECT
147 public:
148     Spatializer( intf_thread_t *, QWidget * );
149
150 private:
151     QSlider *spatCtrl[NUM_SP_CTRL];
152     QLabel *ctrl_texts[NUM_SP_CTRL];
153     QLabel *ctrl_readout[NUM_SP_CTRL];
154     float controlVars[5];
155     float oldControlVars[5];
156
157     QCheckBox *enableCheck;
158
159     void delCallbacks( vlc_object_t * );
160     void addCallbacks( vlc_object_t * );
161     intf_thread_t *p_intf;
162
163     void setValues();
164
165 private slots:
166     void enable(bool);
167     void enable();
168     void setInitValues();
169 };
170
171 class SyncWidget : public QDoubleSpinBox
172 {
173     Q_OBJECT
174 public:
175     SyncWidget( QWidget * );
176 private slots:
177     void valueChangedHandler( double d );
178 };
179
180 class SyncControls : public QWidget
181 {
182     Q_OBJECT
183     friend class ExtendedDialog;
184 public:
185     SyncControls( intf_thread_t *, QWidget * );
186     virtual ~SyncControls();
187 private:
188     intf_thread_t *p_intf;
189     QDoubleSpinBox *AVSpin;
190     QDoubleSpinBox *subsSpin;
191     QDoubleSpinBox *subSpeedSpin;
192     QDoubleSpinBox *subDurationSpin;
193
194     bool b_userAction;
195
196     void clean();
197
198     void initSubsDuration();
199     void subsdelayClean();
200     void subsdelaySetFactor( double );
201 public slots:
202     void update();
203 private slots:
204     void advanceAudio( double );
205     void advanceSubs( double );
206     void adjustSubsSpeed( double );
207     void adjustSubsDuration( double );
208 };
209
210 #endif