123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- /*****************************************************************************
- * extended_panels.hpp : Exentended Panels
- ****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
- * $Id$
- *
- * Authors: Clément Stenac <zorglub@videolan.org>
- * Antoine Cellerier <dionoea at videolan dot org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
- #ifndef VLC_QT_EXTENDED_PANELS_HPP_
- #define VLC_QT_EXTENDED_PANELS_HPP_
- #ifdef HAVE_CONFIG_H
- # include "config.h"
- #endif
- #include <vlc_common.h>
- #include "qt.hpp"
- #include "ui/equalizer.h"
- #include "ui/video_effects.h"
- #include <QTabWidget>
- #define BANDS 10
- class QSignalMapper;
- class ExtVideo: public QObject
- {
- Q_OBJECT
- friend class ExtendedDialog;
- public:
- ExtVideo( struct intf_thread_t *, QTabWidget * );
- static void setPostprocessing( struct intf_thread_t *, int q);
- static int getPostprocessing( struct intf_thread_t *p_intf);
- private:
- Ui::ExtVideoWidget ui;
- QSignalMapper* filterMapper;
- intf_thread_t *p_intf;
- void initComboBoxItems( QObject* );
- void setWidgetValue( QObject* );
- void clean();
- static void setFilterOption( struct intf_thread_t *, const char *psz_module, const char *psz_option, int, double, QString );
- private slots:
- void updateFilters();
- void updateFilterOptions();
- void cropChange();
- void browseLogo();
- void browseEraseFile();
- };
- class ExtV4l2 : public QWidget
- {
- Q_OBJECT
- public:
- ExtV4l2( intf_thread_t *, QWidget * );
- void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
- private:
- intf_thread_t *p_intf;
- QGroupBox *box;
- QLabel *help;
- private slots:
- void Refresh( void );
- void ValueChange( int value );
- void ValueChange( bool value );
- };
- class FilterSliderData : public QObject
- {
- Q_OBJECT
- public:
- typedef struct
- {
- QString name;
- QString descs;
- QString units;
- float f_min; // min
- float f_max; // max
- float f_value; // value
- float f_resolution; // resolution
- float f_visual_multiplier; // only for display (f_value *)
- } slider_data_t;
- FilterSliderData( QObject *parent, intf_thread_t *p_intf,
- QSlider *slider,
- QLabel *valueLabel, QLabel *nameLabel,
- const slider_data_t *p_data );
- void setValue( float f );
- protected:
- FilterSliderData( QObject *parent, QSlider *slider );
- virtual float initialValue();
- QSlider *slider;
- QLabel *valueLabel;
- QLabel *nameLabel;
- const slider_data_t *p_data;
- intf_thread_t *p_intf;
- bool b_save_to_config;
- public slots:
- virtual void onValueChanged( int i ) const;
- virtual void updateText( int i );
- virtual void writeToConfig() const;
- void setSaveToConfig( bool );
- };
- class AudioFilterControlWidget : public QWidget
- {
- Q_OBJECT
- public:
- AudioFilterControlWidget( intf_thread_t *, QWidget *, const char *name );
- virtual ~AudioFilterControlWidget();
- protected:
- virtual void build();
- QVector<FilterSliderData::slider_data_t> controls;
- QVector<FilterSliderData *> sliderDatas;
- QGroupBox *slidersBox;
- intf_thread_t *p_intf;
- QString name; // filter's module name
- int i_smallfont;
- protected slots:
- void enable( bool ) const;
- virtual void setSaveToConfig( bool );
- };
- class EqualizerSliderData : public FilterSliderData
- {
- Q_OBJECT
- public:
- EqualizerSliderData( QObject *parent, intf_thread_t *p_intf,
- QSlider *slider,
- QLabel *valueLabel, QLabel *nameLabel,
- const slider_data_t *p_data, int index );
- protected:
- float initialValue() Q_DECL_OVERRIDE;
- int index;
- QStringList getBandsFromAout() const;
- public slots:
- void onValueChanged( int i ) const Q_DECL_OVERRIDE;
- void writeToConfig() const Q_DECL_OVERRIDE;
- };
- class Equalizer: public AudioFilterControlWidget
- {
- Q_OBJECT
- public:
- Equalizer( intf_thread_t *, QWidget * );
- protected:
- void build() Q_DECL_OVERRIDE;
- protected slots:
- void setSaveToConfig( bool ) Q_DECL_OVERRIDE;
- private:
- FilterSliderData *preamp;
- FilterSliderData::slider_data_t preamp_values;
- private slots:
- void setCorePreset( int );
- void enable2Pass( bool ) const;
- };
- class Compressor: public AudioFilterControlWidget
- {
- Q_OBJECT
- public:
- Compressor( intf_thread_t *, QWidget * );
- };
- class Spatializer: public AudioFilterControlWidget
- {
- Q_OBJECT
- public:
- Spatializer( intf_thread_t *, QWidget * );
- };
- class SyncWidget : public QWidget
- {
- Q_OBJECT
- public:
- SyncWidget( QWidget * );
- void setValue( double d );
- signals:
- void valueChanged( double );
- private slots:
- void valueChangedHandler( double d );
- private:
- QDoubleSpinBox spinBox;
- QLabel spinLabel;
- };
- class SyncControls : public QWidget
- {
- Q_OBJECT
- friend class ExtendedDialog;
- public:
- SyncControls( intf_thread_t *, QWidget * );
- virtual ~SyncControls();
- private:
- intf_thread_t *p_intf;
- SyncWidget *AVSpin;
- SyncWidget *subsSpin;
- QDoubleSpinBox *subSpeedSpin;
- QDoubleSpinBox *subDurationSpin;
- bool b_userAction;
- void clean();
- void initSubsDuration();
- void subsdelayClean();
- void subsdelaySetFactor( double );
- public slots:
- void update();
- private slots:
- void advanceAudio( double );
- void advanceSubs( double );
- void adjustSubsSpeed( double );
- void adjustSubsDuration( double );
- };
- #endif
|