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