Commit 5a6c9e94 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Start of the work for the audio/video/subs synchronisation

parent bf1292e4
/*****************************************************************************
* extended_panels.cpp : Extended controls panels
****************************************************************************
* Copyright ( C ) 2006-2007 the VideoLAN team
* Copyright (C) 2006-2007 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
......@@ -1157,6 +1157,83 @@ void Spatializer::addCallbacks( aout_instance_t *p_aout )
// var_AddCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
}
#include <QToolButton>
#include <QGridLayout>
SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
QWidget( _parent ) , p_intf( _p_intf )
{
QGroupBox *AVBox, *subsBox;
QToolButton *moinsAV, *plusAV;
QToolButton *moinssubs, *plussubs;
QVBoxLayout *vboxLayout = new QVBoxLayout( this );
AVBox = new QGroupBox( qtr( "Audio/Video" ) );
QGridLayout *gridLayout = new QGridLayout( AVBox );
moinsAV = new QToolButton;
moinsAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
moinsAV->setAutoRaise( true );
moinsAV->setText( "-" );
gridLayout->addWidget( moinsAV, 1, 0, 1, 1 );
plusAV = new QToolButton;
plusAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
plusAV->setAutoRaise( true );
plusAV->setText( "+" );
gridLayout->addWidget( plusAV, 1, 2, 1, 1 );
QLabel *AVLabel = new QLabel;
AVLabel->setText( qtr( "Advance of audio over video" ) );
gridLayout->addWidget( AVLabel, 0, 0, 1, 3 );
AVSpin = new QDoubleSpinBox;
AVSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
AVSpin->setDecimals( 3 );
AVSpin->setMinimum( -100 );
AVSpin->setMaximum( 100 );
AVSpin->setSingleStep( 0.1 );
AVSpin->setToolTip( qtr( "A positive value means that\n"
"the audio is ahead of the video" ) );
AVSpin->setSuffix( "ms" );
gridLayout->addWidget( AVSpin, 1, 1, 1, 1 );
vboxLayout->addWidget( AVBox );
subsBox = new QGroupBox( qtr( "Subtitles/Video" ) );
QGridLayout *subsLayout = new QGridLayout( subsBox );
moinssubs = new QToolButton;
moinssubs->setToolButtonStyle( Qt::ToolButtonTextOnly );
moinssubs->setAutoRaise( true );
moinssubs->setText( "-" );
subsLayout->addWidget( moinssubs, 1, 0, 1, 1 );
plussubs = new QToolButton;
plussubs->setToolButtonStyle( Qt::ToolButtonTextOnly );
plussubs->setAutoRaise( true );
plussubs->setText( "+" );
subsLayout->addWidget( plussubs, 1, 2, 1, 1 );
QLabel *subsLabel = new QLabel;
subsLabel->setText( qtr( "Advance of subtitles over video" ) );
subsLayout->addWidget( subsLabel, 0, 0, 1, 3 );
subsSpin = new QDoubleSpinBox;
subsSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
subsSpin->setDecimals( 3 );
subsSpin->setMinimum( -100 );
subsSpin->setMaximum( 100 );
subsSpin->setSingleStep( 0.1 );
subsSpin->setToolTip( qtr( "A positive value means that\n"
"the subtitles are ahead of the video" ) );
subsSpin->setSuffix( "ms" );
subsLayout->addWidget( subsSpin, 1, 1, 1, 1 );
vboxLayout->addWidget( subsBox );
}
/**********************************************************************
* Video filters / Adjust
**********************************************************************/
......
......@@ -150,4 +150,16 @@ private slots:
void snapshot() {};
};
class SyncControls : public QWidget
{
Q_OBJECT
public:
SyncControls( intf_thread_t *, QWidget * );
virtual ~SyncControls() {};
private:
intf_thread_t *p_intf;
QDoubleSpinBox *AVSpin;
QDoubleSpinBox *subsSpin;
};
#endif
......@@ -43,7 +43,6 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
QGridLayout *layout = new QGridLayout( this );
QTabWidget *mainTabW = new QTabWidget( this );
mainTabW->setTabPosition( QTabWidget::West );
/* AUDIO effects */
QWidget *audioWidget = new QWidget;
......@@ -70,6 +69,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
mainTabW->addTab( videoWidget, qtr( "Video Effects" ) );
SyncControls *syncW = new SyncControls( p_intf, videoTab );
mainTabW->addTab( syncW, qtr( "A/V Synchronisation" ) );
if( module_Exists( p_intf, "v4l2" ) )
{
ExtV4l2 *v4l2 = new ExtV4l2( p_intf, mainTabW );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment