]> git.sesse.net Git - vlc/commitdiff
Connect the buttons to the actions.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 31 Mar 2008 05:09:12 +0000 (22:09 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 31 Mar 2008 05:09:12 +0000 (22:09 -0700)
Renamings.

modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.hpp

index 5c64e912bb5d442e95c65783c651a49f5a7893a3..a6ab55c658656c4ec0bb570dc3d3045511dd2c87 100755 (executable)
@@ -1165,32 +1165,34 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
                             QWidget( _parent ) , p_intf( _p_intf )
 {
     QGroupBox *AVBox, *subsBox;
-    QToolButton *moinsAV, *plusAV;
 
+    QToolButton *moinsAV, *plusAV;
     QToolButton *moinssubs, *plussubs;
     QToolButton *moinssubSpeed, *plussubSpeed;
 
+    QToolButton *updateButton;
 
-    QVBoxLayout *vboxLayout = new QVBoxLayout( this );
+    QGridLayout *mainLayout = new QGridLayout( this );
 
+    /* AV sync */
     AVBox = new QGroupBox( qtr( "Audio/Video" ) );
-    QGridLayout *gridLayout = new QGridLayout( AVBox );
+    QGridLayout *AVLayout = new QGridLayout( AVBox );
 
     moinsAV = new QToolButton;
     moinsAV->setToolButtonStyle( Qt::ToolButtonTextOnly );
     moinsAV->setAutoRaise( true );
     moinsAV->setText( "-" );
-    gridLayout->addWidget( moinsAV, 1, 0, 1, 1 );
+    AVLayout->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 );
+    AVLayout->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 );
+    AVLayout->addWidget( AVLabel, 0, 0, 1, 3 );
 
     AVSpin = new QDoubleSpinBox;
     AVSpin->setAlignment( Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter );
@@ -1201,10 +1203,11 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
     AVSpin->setToolTip( qtr( "A positive value means that\n"
                              "the audio is ahead of the video" ) );
     AVSpin->setSuffix( "s" );
-    gridLayout->addWidget( AVSpin, 1, 1, 1, 1 );
-    vboxLayout->addWidget( AVBox );
+    AVLayout->addWidget( AVSpin, 1, 1, 1, 1 );
+    mainLayout->addWidget( AVBox, 1, 0, 1, 5 );
 
 
+    /* Subs */
     subsBox = new QGroupBox( qtr( "Subtitles/Video" ) );
     QGridLayout *subsLayout = new QGridLayout( subsBox );
 
@@ -1260,15 +1263,19 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
     subSpeedSpin->setSingleStep( 0.2 );
     subsLayout->addWidget( subSpeedSpin, 3, 1, 1, 1 );
 
-    vboxLayout->addWidget( subsBox );
+    mainLayout->addWidget( subsBox, 2, 0, 1, 5 );
 
     /* Various Connects */
     CONNECT( moinsAV, clicked(), AVSpin, stepDown () );
     CONNECT( plusAV, clicked(), AVSpin, stepUp () );
     CONNECT( moinssubs, clicked(), subsSpin, stepDown () );
     CONNECT( plussubs, clicked(), subsSpin, stepUp () );
+    CONNECT( moinssubSpeed, clicked(), subSpeedSpin, stepDown () );
+    CONNECT( plussubSpeed, clicked(), subSpeedSpin, stepUp () );
     CONNECT( AVSpin, valueChanged ( double ), this, advanceAudio( double ) ) ;
     CONNECT( subsSpin, valueChanged ( double ), this, advanceSubs( double ) ) ;
+    CONNECT( subSpeedSpin, alueChanged ( double ),
+             this, adjustSubsSpeed( double ) );
 
     /* Set it */
     update();
@@ -1309,6 +1316,14 @@ void SyncControls::advanceSubs( double f_advance )
     }
 }
 
+void SyncControls::adjustSubsSpeed( double f_fps )
+{
+    if( THEMIM->getInput() )
+    {
+        var_SetFloat( THEMIM->getInput(), "sub-fps", f_fps );
+    }
+}
+
 /**********************************************************************
  * Video filters / Adjust
  **********************************************************************/
index 4d19770ea13c40aae33d4922793506d6ee9415bc..60a2fd42506ff74798cdab0e95faada86341dd7b 100644 (file)
@@ -166,6 +166,7 @@ public slots:
 private slots:
     void advanceAudio( double );
     void advanceSubs( double );
+    void adjustSubsSpeed( double );
 };
 
 #endif