]> git.sesse.net Git - vlc/commitdiff
Start of the work for the audio/video/subs synchronisation
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 30 Mar 2008 02:08:07 +0000 (19:08 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 30 Mar 2008 03:44:29 +0000 (20:44 -0700)
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/dialogs/extended.cpp

index db282876bc2d59a39e9c5c12d957d6095cd6daca..7d00edcf1cdc13b5a8f748288188b73505d163d8 100755 (executable)
@@ -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 <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
  **********************************************************************/
index 08a7c29cc6c07b623d6a16f2b4d4e00ef6375d3c..0f4da973a79548d7b81eea4763128649476364a7 100644 (file)
@@ -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
index af9c7ed81f999211ef92d1dd31c59f34b8738488..9d0f3871de2604c912c5d5b03830ac2791338ebc 100644 (file)
@@ -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 );