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 * );
50 Ui::ExtVideoWidget ui;
51 QSignalMapper* filterMapper;
52 intf_thread_t *p_intf;
53 void initComboBoxItems( QObject* );
54 void setWidgetValue( QObject* );
58 void updateFilterOptions();
61 void browseEraseFile();
64 class ExtV4l2 : public QWidget
68 ExtV4l2( intf_thread_t *, QWidget * );
70 virtual void showEvent( QShowEvent *event );
73 intf_thread_t *p_intf;
79 void ValueChange( int value );
80 void ValueChange( bool value );
83 class FilterSliderData : public QObject
95 float f_value; // value
96 float f_resolution; // resolution
97 float f_visual_multiplier; // only for display (f_value *)
99 FilterSliderData( QObject *parent, intf_thread_t *p_intf,
101 QLabel *valueLabel, QLabel *nameLabel,
102 const slider_data_t *p_data );
103 void setValue( float f );
106 FilterSliderData( QObject *parent, QSlider *slider );
107 virtual float initialValue();
111 const slider_data_t *p_data;
112 intf_thread_t *p_intf;
113 bool b_save_to_config;
116 virtual void onValueChanged( int i ) const;
117 virtual void updateText( int i );
118 virtual void writeToConfig() const;
119 void setSaveToConfig( bool );
122 class AudioFilterControlWidget : public QWidget
127 AudioFilterControlWidget( intf_thread_t *, QWidget *, const char *name );
128 virtual ~AudioFilterControlWidget();
131 virtual void build();
132 QVector<FilterSliderData::slider_data_t> controls;
133 QVector<FilterSliderData *> sliderDatas;
134 QGroupBox *slidersBox;
135 intf_thread_t *p_intf;
136 QString name; // filter's module name
140 void enable( bool ) const;
141 virtual void setSaveToConfig( bool );
144 class EqualizerSliderData : public FilterSliderData
149 EqualizerSliderData( QObject *parent, intf_thread_t *p_intf,
151 QLabel *valueLabel, QLabel *nameLabel,
152 const slider_data_t *p_data, int index );
155 virtual float initialValue();
157 QStringList getBandsFromAout() const;
160 virtual void onValueChanged( int i ) const;
161 virtual void writeToConfig() const;
164 class Equalizer: public AudioFilterControlWidget
169 Equalizer( intf_thread_t *, QWidget * );
172 virtual void build();
175 virtual void setSaveToConfig( bool );
178 FilterSliderData *preamp;
179 FilterSliderData::slider_data_t preamp_values;
182 void setCorePreset( int );
183 void enable2Pass( bool ) const;
186 class Compressor: public AudioFilterControlWidget
191 Compressor( intf_thread_t *, QWidget * );
194 class Spatializer: public AudioFilterControlWidget
199 Spatializer( intf_thread_t *, QWidget * );
202 class SyncWidget : public QWidget
206 SyncWidget( QWidget * );
207 void setValue( double d );
209 void valueChanged( double );
211 void valueChangedHandler( double d );
213 QDoubleSpinBox spinBox;
217 class SyncControls : public QWidget
220 friend class ExtendedDialog;
222 SyncControls( intf_thread_t *, QWidget * );
223 virtual ~SyncControls();
225 intf_thread_t *p_intf;
227 SyncWidget *subsSpin;
228 QDoubleSpinBox *subSpeedSpin;
229 QDoubleSpinBox *subDurationSpin;
235 void initSubsDuration();
236 void subsdelayClean();
237 void subsdelaySetFactor( double );
241 void advanceAudio( double );
242 void advanceSubs( double );
243 void adjustSubsSpeed( double );
244 void adjustSubsDuration( double );