]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/extended_panels.hpp
03ee21aac659e2e046236bba51a4a309f20ed7c3
[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 #include <vlc_aout.h>
34 #include "../../audio_filter/equalizer_presets.h"
35
36 #include "ui/equalizer.h"
37 #include "ui/video_effects.h"
38 #include "ui/v4l2.h"
39
40 #include <QTabWidget>
41
42 #define BANDS EQZ_BANDS_MAX
43 #define NUM_SP_CTRL 5
44
45 class QSignalMapper;
46
47 class ExtVideo: public QObject
48 {
49     Q_OBJECT
50     friend class ExtendedDialog;
51 public:
52     ExtVideo( intf_thread_t *, QTabWidget * );
53     virtual ~ExtVideo();
54     /*void gotoConf( QObject* );*/
55 private:
56     Ui::ExtVideoWidget ui;
57     QSignalMapper* filterMapper;
58     intf_thread_t *p_intf;
59     vout_thread_t *p_vout;
60     void initComboBoxItems( QObject* );
61     void setWidgetValue( QObject* );
62     void ChangeVFiltersString( const char *psz_name, bool b_add );
63     void clean();
64 private slots:
65     void updateFilters();
66     void updateFilterOptions();
67     void cropChange();
68 };
69
70 class ExtV4l2 : public QWidget
71 {
72     Q_OBJECT
73 public:
74     ExtV4l2( intf_thread_t *, QWidget * );
75     virtual ~ExtV4l2();
76
77     virtual void showEvent( QShowEvent *event );
78
79 private:
80     intf_thread_t *p_intf;
81     Ui::ExtV4l2Widget ui;
82     QGroupBox *box;
83
84 private slots:
85     void Refresh( void );
86     void ValueChange( int value );
87     void ValueChange( bool value );
88 };
89
90 class Equalizer: public QWidget
91 {
92     Q_OBJECT
93     friend class ExtendedDialog;
94 public:
95     Equalizer( intf_thread_t *, QWidget * );
96     virtual ~Equalizer();
97     QComboBox *presetsComboBox;
98
99     char * createValuesFromPreset( int i_preset );
100     void updateUIFromCore();
101 private:
102     Ui::EqualizerWidget ui;
103     QSlider *bands[BANDS];
104     QLabel *band_texts[BANDS];
105
106     void delCallbacks( aout_instance_t * );
107     void addCallbacks( aout_instance_t * );
108
109     intf_thread_t *p_intf;
110     void clean();
111 private slots:
112     void enable(bool);
113     void enable();
114     void set2Pass();
115     void setPreamp();
116     void setCoreBands();
117     void setCorePreset(int);
118     void updateUISliderValues( int );
119 };
120
121 class Spatializer: public QWidget
122 {
123     Q_OBJECT
124 public:
125     Spatializer( intf_thread_t *, QWidget * );
126     virtual ~Spatializer();
127
128 private:
129     QSlider *spatCtrl[NUM_SP_CTRL];
130     QLabel *ctrl_texts[NUM_SP_CTRL];
131     QLabel *ctrl_readout[NUM_SP_CTRL];
132     float controlVars[5];
133     float oldControlVars[5];
134
135     QCheckBox *enableCheck;
136
137     void delCallbacks( aout_instance_t * );
138     void addCallbacks( aout_instance_t * );
139     intf_thread_t *p_intf;
140 private slots:
141     void enable(bool);
142     void enable();
143     void setValues(float *);
144     void setInitValues();
145 };
146
147 class SyncControls : public QWidget
148 {
149     Q_OBJECT
150     friend class ExtendedDialog;
151 public:
152     SyncControls( intf_thread_t *, QWidget * );
153     virtual ~SyncControls() {};
154 private:
155     intf_thread_t *p_intf;
156     QDoubleSpinBox *AVSpin;
157     QDoubleSpinBox *subsSpin;
158     QDoubleSpinBox *subSpeedSpin;
159
160     bool b_userAction;
161
162     void clean();
163 public slots:
164     void update();
165 private slots:
166     void advanceAudio( double );
167     void advanceSubs( double );
168     void adjustSubsSpeed( double );
169 };
170
171 #endif