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