* extended_panels.hpp : Exentended Panels
****************************************************************************
* Copyright (C) 2006 the VideoLAN team
- * $Id: preferences.hpp 16643 2006-09-13 12:45:46Z zorglub $
+ * $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
#ifndef _EQUALIZER_H_
#define _EQUALIZER_H_
-#include <vlc/vlc.h>
-#include <vlc_aout.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include "ui/equalizer.h"
#include "ui/video_effects.h"
+#include <QTabWidget>
+
#define BANDS 10
class QSignalMapper;
-class ExtVideo: public QWidget
+class ExtVideo: public QObject
{
Q_OBJECT
+ friend class ExtendedDialog;
public:
- ExtVideo( intf_thread_t *, QWidget * );
- virtual ~ExtVideo();
+ ExtVideo( struct intf_thread_t *, QTabWidget * );
/*void gotoConf( QObject* );*/
private:
Ui::ExtVideoWidget ui;
intf_thread_t *p_intf;
void initComboBoxItems( QObject* );
void setWidgetValue( QObject* );
- void ChangeVFiltersString( char *psz_name, vlc_bool_t b_add );
+ void clean();
private slots:
void updateFilters();
void updateFilterOptions();
+ void cropChange();
+ void browseLogo();
+ void browseEraseFile();
+};
+
+class ExtV4l2 : public QWidget
+{
+ Q_OBJECT
+public:
+ ExtV4l2( intf_thread_t *, QWidget * );
+
+ virtual void showEvent( QShowEvent *event );
+
+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:
+ float initialValue();
+
+public slots:
+ void onValueChanged( int i );
+ void updateText( int i );
+ void writeToConfig();
+
+private:
+ intf_thread_t *p_intf;
+ QSlider *slider;
+ QLabel *valueLabel;
+ QLabel *nameLabel;
+ const slider_data_t *p_data;
+};
+
+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;
+ QGroupBox *slidersBox;
+ intf_thread_t *p_intf;
+ QString name; // filter's module name
+ int i_smallfont;
+
+protected slots:
+ void enable();
};
class Equalizer: public QWidget
{
Q_OBJECT
+ friend class ExtendedDialog;
public:
Equalizer( intf_thread_t *, QWidget * );
- virtual ~Equalizer();
+ QComboBox *presetsComboBox;
+ char * createValuesFromPreset( int i_preset );
+ void updateUIFromCore();
+ void changeFreqLabels( bool );
private:
Ui::EqualizerWidget ui;
QSlider *bands[BANDS];
QLabel *band_texts[BANDS];
+ bool b_vlcBands;
- void delCallbacks( aout_instance_t * );
- void addCallbacks( aout_instance_t * );
- void setValues( char *, float );
+ void delCallbacks( vlc_object_t * );
+ void addCallbacks( vlc_object_t * );
intf_thread_t *p_intf;
+ void clean() { enable(); }
private slots:
void enable(bool);
void enable();
void set2Pass();
void setPreamp();
- void setBand();
- void setPreset(int);
+ void setCoreBands();
+ void setCorePreset(int);
+};
+
+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 ExtendedControls: public QWidget
+class SyncWidget : public QWidget
{
Q_OBJECT
public:
- ExtendedControls( intf_thread_t *, QWidget * ) {};
- virtual ~ExtendedControls() {};
+ 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 slower() {};
- void faster() {};
- void normal() {};
- void snapshot() {};
+ void advanceAudio( double );
+ void advanceSubs( double );
+ void adjustSubsSpeed( double );
+ void adjustSubsDuration( double );
};
#endif