]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/extended_panels.hpp
Fix part of the extended panel generation using us_strtod()
[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 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( char *psz_name, bool b_add );
63 private slots:
64     void updateFilters();
65     void updateFilterOptions();
66     void cropChange();
67 };
68
69 class ExtV4l2 : public QWidget
70 {
71     Q_OBJECT
72 public:
73     ExtV4l2( intf_thread_t *, QWidget * );
74     virtual ~ExtV4l2();
75
76     virtual void showEvent( QShowEvent *event );
77
78 private:
79     intf_thread_t *p_intf;
80     Ui::ExtV4l2Widget ui;
81     QGroupBox *box;
82
83 private slots:
84     void Refresh( void );
85     void ValueChange( int value );
86     void ValueChange( bool value );
87 };
88
89 class Equalizer: public QWidget
90 {
91     Q_OBJECT
92 public:
93     Equalizer( intf_thread_t *, QWidget * );
94     virtual ~Equalizer();
95     QComboBox *presetsComboBox;
96
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     void updateUIValues( char *, float );
105     char * createValuesFromPreset( int i_preset );
106
107     intf_thread_t *p_intf;
108 private slots:
109     void enable(bool);
110     void enable();
111     void set2Pass();
112     void setPreamp();
113     void changeCoreBands();
114     void setPreset(int);
115 };
116
117 class Spatializer: public QWidget
118 {
119     Q_OBJECT
120 public:
121     Spatializer( intf_thread_t *, QWidget * );
122     virtual ~Spatializer();
123
124 private:
125     QSlider *spatCtrl[NUM_SP_CTRL];
126     QLabel *ctrl_texts[NUM_SP_CTRL];
127     QLabel *ctrl_readout[NUM_SP_CTRL];
128     float controlVars[5];
129     float oldControlVars[5];
130
131     QCheckBox *enableCheck;
132
133     void delCallbacks( aout_instance_t * );
134     void addCallbacks( aout_instance_t * );
135     intf_thread_t *p_intf;
136 private slots:
137     void enable(bool);
138     void enable();
139     void setValues(float *);
140     void setInitValues();
141 };
142
143 class ExtendedControls: public QWidget
144 {
145     Q_OBJECT
146 public:
147     ExtendedControls( intf_thread_t *, QWidget * ) {};
148     virtual ~ExtendedControls() {};
149
150 private:
151     intf_thread_t *p_intf;
152 private slots:
153     void slower() {};
154     void faster() {};
155     void normal() {};
156     void snapshot() {};
157 };
158
159 class SyncControls : public QWidget
160 {
161     Q_OBJECT
162 public:
163     SyncControls( intf_thread_t *, QWidget * );
164     virtual ~SyncControls() {};
165 private:
166     intf_thread_t *p_intf;
167     QDoubleSpinBox *AVSpin;
168     QDoubleSpinBox *subsSpin;
169     QDoubleSpinBox *subSpeedSpin;
170 public slots:
171     void update();
172 private slots:
173     void advanceAudio( double );
174     void advanceSubs( double );
175     void adjustSubsSpeed( double );
176 };
177
178 #endif