]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/extended_panels.hpp
Automatically refresh the v4l2 extended panel on focus.
[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: preferences.hpp 16643 2006-09-13 12:45:46Z zorglub $
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 #include <vlc/vlc.h>
29 #include <vlc_aout.h>
30
31 #include "ui/equalizer.h"
32 #include "ui/video_effects.h"
33 #include "ui/v4l2.h"
34
35 #define BANDS 10
36 #define NUM_SP_CTRL 5
37
38 class QSignalMapper;
39
40 class ExtVideo: public QWidget
41 {
42     Q_OBJECT
43 public:
44     ExtVideo( intf_thread_t *, QWidget * );
45     virtual ~ExtVideo();
46     /*void gotoConf( QObject* );*/
47 private:
48     Ui::ExtVideoWidget ui;
49     QSignalMapper* filterMapper;
50     intf_thread_t *p_intf;
51     void initComboBoxItems( QObject* );
52     void setWidgetValue( QObject* );
53     void ChangeVFiltersString( char *psz_name, vlc_bool_t b_add );
54 private slots:
55     void updateFilters();
56     void updateFilterOptions();
57 };
58
59 class ExtV4l2 : public QWidget
60 {
61     Q_OBJECT
62 public:
63     ExtV4l2( intf_thread_t *, QWidget * );
64     virtual ~ExtV4l2();
65
66     virtual void showEvent( QShowEvent *event );
67
68 private:
69     intf_thread_t *p_intf;
70     Ui::ExtV4l2Widget ui;
71     QGroupBox *box;
72
73 private slots:
74     void Refresh( void );
75     void ValueChange( int value );
76     void ValueChange( bool value );
77 };
78
79 class Equalizer: public QWidget
80 {
81     Q_OBJECT
82 public:
83     Equalizer( intf_thread_t *, QWidget * );
84     virtual ~Equalizer();
85     QComboBox *presetsComboBox;
86
87 private:
88     Ui::EqualizerWidget ui;
89     QSlider *bands[BANDS];
90     QLabel *band_texts[BANDS];
91
92     void delCallbacks( aout_instance_t * );
93     void addCallbacks( aout_instance_t * );
94     void setValues( char *, float );
95
96     intf_thread_t *p_intf;
97 private slots:
98     void enable(bool);
99     void enable();
100     void set2Pass();
101     void setPreamp();
102     void setBand();
103     void setPreset(int);
104 };
105
106 class Spatializer: public QWidget
107 {
108     Q_OBJECT
109 public:
110     Spatializer( intf_thread_t *, QWidget * );
111     virtual ~Spatializer();
112
113 private:
114     QSlider *spatCtrl[NUM_SP_CTRL];
115     QLabel *ctrl_texts[NUM_SP_CTRL];
116     QLabel *ctrl_readout[NUM_SP_CTRL];
117     float controlVars[5];
118     float oldControlVars[5];
119
120     QCheckBox *enableCheck;
121
122     void delCallbacks( aout_instance_t * );
123     void addCallbacks( aout_instance_t * );
124     intf_thread_t *p_intf;
125 private slots:
126     void enable(bool);
127     void enable();
128     void setValues(float *);
129     void setInitValues();
130 };
131
132 class ExtendedControls: public QWidget
133 {
134     Q_OBJECT
135 public:
136     ExtendedControls( intf_thread_t *, QWidget * ) {};
137     virtual ~ExtendedControls() {};
138
139 private:
140     intf_thread_t *p_intf;
141 private slots:
142     void slower() {};
143     void faster() {};
144     void normal() {};
145     void snapshot() {};
146 };
147
148 #endif