From 5a6c9e944a90d2d9da88a03b5e3de548a3592d7d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sat, 29 Mar 2008 19:08:07 -0700 Subject: [PATCH] Start of the work for the audio/video/subs synchronisation --- .../gui/qt4/components/extended_panels.cpp | 79 ++++++++++++++++++- .../gui/qt4/components/extended_panels.hpp | 12 +++ modules/gui/qt4/dialogs/extended.cpp | 4 +- 3 files changed, 93 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp index db282876bc..7d00edcf1c 100755 --- a/modules/gui/qt4/components/extended_panels.cpp +++ b/modules/gui/qt4/components/extended_panels.cpp @@ -1,7 +1,7 @@ /***************************************************************************** * 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 @@ -1157,6 +1157,83 @@ void Spatializer::addCallbacks( aout_instance_t *p_aout ) // var_AddCallback( p_aout, "Spatializer-preamp", EqzCallback, this ); } +#include +#include + +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 **********************************************************************/ diff --git a/modules/gui/qt4/components/extended_panels.hpp b/modules/gui/qt4/components/extended_panels.hpp index 08a7c29cc6..0f4da973a7 100644 --- a/modules/gui/qt4/components/extended_panels.hpp +++ b/modules/gui/qt4/components/extended_panels.hpp @@ -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 diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp index af9c7ed81f..9d0f3871de 100644 --- a/modules/gui/qt4/dialogs/extended.cpp +++ b/modules/gui/qt4/dialogs/extended.cpp @@ -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 ); -- 2.39.2