]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/extended_panels.hpp
a4bbb4f3c369864b6de86ad700214b84d35cb74e
[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_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     virtual ~ExtVideo();
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     virtual ~ExtV4l2();
74
75     virtual void showEvent( QShowEvent *event );
76
77 private:
78     intf_thread_t *p_intf;
79     Ui::ExtV4l2Widget ui;
80     QGroupBox *box;
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     virtual ~Equalizer();
95     QComboBox *presetsComboBox;
96
97     char * createValuesFromPreset( int i_preset );
98     void updateUIFromCore();
99 private:
100     Ui::EqualizerWidget ui;
101     QSlider *bands[BANDS];
102     QLabel *band_texts[BANDS];
103
104     void delCallbacks( aout_instance_t * );
105     void addCallbacks( aout_instance_t * );
106
107     intf_thread_t *p_intf;
108     void clean();
109 private slots:
110     void enable(bool);
111     void enable();
112     void set2Pass();
113     void setPreamp();
114     void setCoreBands();
115     void setCorePreset(int);
116 };
117
118 class Spatializer: public QWidget
119 {
120     Q_OBJECT
121 public:
122     Spatializer( intf_thread_t *, QWidget * );
123     virtual ~Spatializer();
124
125 private:
126     QSlider *spatCtrl[NUM_SP_CTRL];
127     QLabel *ctrl_texts[NUM_SP_CTRL];
128     QLabel *ctrl_readout[NUM_SP_CTRL];
129     float controlVars[5];
130     float oldControlVars[5];
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 setValues(float *);
141     void setInitValues();
142 };
143
144 class SyncControls : public QWidget
145 {
146     Q_OBJECT
147     friend class ExtendedDialog;
148 public:
149     SyncControls( intf_thread_t *, QWidget * );
150     virtual ~SyncControls() {};
151 private:
152     intf_thread_t *p_intf;
153     QDoubleSpinBox *AVSpin;
154     QDoubleSpinBox *subsSpin;
155     QDoubleSpinBox *subSpeedSpin;
156
157     bool b_userAction;
158
159     void clean();
160 public slots:
161     void update();
162 private slots:
163     void advanceAudio( double );
164     void advanceSubs( double );
165     void adjustSubsSpeed( double );
166 };
167
168 #endif