1 /*****************************************************************************
2 * extended_panels.hpp : Exentended Panels
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Antoine Cellerier <dionoea at videolan dot org>
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.
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.
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 *****************************************************************************/
32 #include <vlc_common.h>
34 #include "ui/equalizer.h"
35 #include "ui/video_effects.h"
43 class ExtVideo: public QObject
46 friend class ExtendedDialog;
48 ExtVideo( struct intf_thread_t *, QTabWidget * );
49 /*void gotoConf( QObject* );*/
51 Ui::ExtVideoWidget ui;
52 QSignalMapper* filterMapper;
53 intf_thread_t *p_intf;
54 void initComboBoxItems( QObject* );
55 void setWidgetValue( QObject* );
59 void updateFilterOptions();
62 void browseEraseFile();
65 class ExtV4l2 : public QWidget
69 ExtV4l2( intf_thread_t *, QWidget * );
71 virtual void showEvent( QShowEvent *event );
74 intf_thread_t *p_intf;
80 void ValueChange( int value );
81 void ValueChange( bool value );
84 class FilterSliderData : public QObject
96 float f_value; // value
97 float f_resolution; // resolution
98 float f_visual_multiplier; // only for display (f_value *)
100 FilterSliderData( QObject *parent, intf_thread_t *p_intf,
102 QLabel *valueLabel, QLabel *nameLabel,
103 const slider_data_t *p_data );
104 void setValue( float f );
107 FilterSliderData( QObject *parent, QSlider *slider );
108 virtual float initialValue();
112 const slider_data_t *p_data;
113 intf_thread_t *p_intf;
116 virtual void onValueChanged( int i ) const;
117 virtual void updateText( int i );
118 virtual void writeToConfig() const;
121 class AudioFilterControlWidget : public QWidget
126 AudioFilterControlWidget( intf_thread_t *, QWidget *, const char *name );
127 virtual ~AudioFilterControlWidget();
130 virtual void build();
131 QVector<FilterSliderData::slider_data_t> controls;
132 QGroupBox *slidersBox;
133 intf_thread_t *p_intf;
134 QString name; // filter's module name
138 void enable( bool ) const;
141 class EqualizerSliderData : public FilterSliderData
146 EqualizerSliderData( QObject *parent, intf_thread_t *p_intf,
148 QLabel *valueLabel, QLabel *nameLabel,
149 const slider_data_t *p_data, int index );
152 virtual float initialValue();
154 QStringList getBandsFromAout() const;
157 virtual void onValueChanged( int i ) const;
158 virtual void writeToConfig() const;
161 class Equalizer: public AudioFilterControlWidget
166 Equalizer( intf_thread_t *, QWidget * );
169 virtual void build();
172 QVector<FilterSliderData *> eqSliders;
173 FilterSliderData *preamp;
174 FilterSliderData::slider_data_t preamp_values;
177 void setCorePreset( int );
178 void enable2Pass( bool ) const;
181 class Compressor: public AudioFilterControlWidget
186 Compressor( intf_thread_t *, QWidget * );
189 class Spatializer: public AudioFilterControlWidget
194 Spatializer( intf_thread_t *, QWidget * );
197 class SyncWidget : public QWidget
201 SyncWidget( QWidget * );
202 void setValue( double d );
204 void valueChanged( double );
206 void valueChangedHandler( double d );
208 QDoubleSpinBox spinBox;
212 class SyncControls : public QWidget
215 friend class ExtendedDialog;
217 SyncControls( intf_thread_t *, QWidget * );
218 virtual ~SyncControls();
220 intf_thread_t *p_intf;
222 SyncWidget *subsSpin;
223 QDoubleSpinBox *subSpeedSpin;
224 QDoubleSpinBox *subDurationSpin;
230 void initSubsDuration();
231 void subsdelayClean();
232 void subsdelaySetFactor( double );
236 void advanceAudio( double );
237 void advanceSubs( double );
238 void adjustSubsSpeed( double );
239 void adjustSubsDuration( double );