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