]> git.sesse.net Git - vlc/commitdiff
Fix the reminiscence of some extended settings and work-around the lack of persistenc...
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 25 Aug 2008 01:49:39 +0000 (18:49 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 25 Aug 2008 01:49:39 +0000 (18:49 -0700)
Ref #1752 and complaints on IRC. #1866 and #1795

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

index 49b0681b8d3ca5deb9662b967ec38604c3433d36..8accbf94356d96b2cdb848fb6eef13ab900d36ae 100644 (file)
@@ -237,6 +237,14 @@ void ExtVideo::cropChange()
     }
 }
 
+void ExtVideo::clean()
+{
+    ui.cropTopPx->setValue( 0 );
+    ui.cropBotPx->setValue( 0 );
+    ui.cropLeftPx->setValue( 0 );
+    ui.cropRightPx->setValue( 0 );
+}
+
 void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
 {
     char *psz_parser, *psz_string;
@@ -858,6 +866,11 @@ Equalizer::~Equalizer()
 {
 }
 
+void Equalizer::clean()
+{
+    ui.enableCheck->setChecked( false );
+    enable();
+}
 /* Write down initial values */
 void Equalizer::updateUIFromCore()
 {
@@ -1361,6 +1374,13 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
     update();
 }
 
+void SyncControls::clean()
+{
+    AVSpin->setValue( 0.0 );
+    subsSpin->setValue( 0.0 );
+    subSpeedSpin->setValue( 1.0 );
+}
+
 void SyncControls::update()
 {
     int64_t i_delay;
index fd56a253314e23b7cdaa3c4847cd9fe66e8c2765..aaffd02ec838419e2b6237b902cb23e58eb90c02 100644 (file)
@@ -48,6 +48,7 @@ class QSignalMapper;
 class ExtVideo: public QObject
 {
     Q_OBJECT
+    friend class ExtendedDialog;
 public:
     ExtVideo( intf_thread_t *, QTabWidget * );
     virtual ~ExtVideo();
@@ -60,6 +61,7 @@ private:
     void initComboBoxItems( QObject* );
     void setWidgetValue( QObject* );
     void ChangeVFiltersString( char *psz_name, bool b_add );
+    void clean();
 private slots:
     void updateFilters();
     void updateFilterOptions();
@@ -89,6 +91,7 @@ private slots:
 class Equalizer: public QWidget
 {
     Q_OBJECT
+    friend class ExtendedDialog;
 public:
     Equalizer( intf_thread_t *, QWidget * );
     virtual ~Equalizer();
@@ -105,6 +108,7 @@ private:
     void addCallbacks( aout_instance_t * );
 
     intf_thread_t *p_intf;
+    void clean();
 private slots:
     void enable(bool);
     void enable();
@@ -141,25 +145,10 @@ private slots:
     void setInitValues();
 };
 
-class ExtendedControls: public QWidget
-{
-    Q_OBJECT
-public:
-    ExtendedControls( intf_thread_t *, QWidget * ) {};
-    virtual ~ExtendedControls() {};
-
-private:
-    intf_thread_t *p_intf;
-private slots:
-    void slower() {};
-    void faster() {};
-    void normal() {};
-    void snapshot() {};
-};
-
 class SyncControls : public QWidget
 {
     Q_OBJECT
+    friend class ExtendedDialog;
 public:
     SyncControls( intf_thread_t *, QWidget * );
     virtual ~SyncControls() {};
@@ -168,6 +157,7 @@ private:
     QDoubleSpinBox *AVSpin;
     QDoubleSpinBox *subsSpin;
     QDoubleSpinBox *subSpeedSpin;
+    void clean();
 public slots:
     void update();
 private slots:
index c02dcc1181aa0e12c35f4b82085f8113e8c6663b..d771f45a8e47ebdcfeaa11c521c1e85f45455208 100644 (file)
 
 #include "dialogs/extended.hpp"
 #include "dialogs_provider.hpp"
-#include "components/extended_panels.hpp"
-
 
 #include "main_interface.hpp"
+#include "input_manager.hpp"
+
 #include <QTabWidget>
 #include <QGridLayout>
 
@@ -53,7 +53,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget );
     QTabWidget *audioTab = new QTabWidget( audioWidget );
 
-    Equalizer *equal = new Equalizer( p_intf, audioTab );
+    equal = new Equalizer( p_intf, audioTab );
     audioTab->addTab( equal, qtr( "Graphic Equalizer" ) );
 
     Spatializer *spatial = new Spatializer( p_intf, audioTab );
@@ -67,13 +67,13 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     QHBoxLayout *videoLayout = new QHBoxLayout( videoWidget );
     QTabWidget *videoTab = new QTabWidget( videoWidget );
 
-    ExtVideo *videoEffect = new ExtVideo( p_intf, videoTab );
+    videoEffect = new ExtVideo( p_intf, videoTab );
     videoLayout->addWidget( videoTab );
     videoTab->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
 
     mainTabW->addTab( videoWidget, qtr( "Video Effects" ) );
 
-    SyncControls *syncW = new SyncControls( p_intf, videoTab );
+    syncW = new SyncControls( p_intf, videoTab );
     mainTabW->addTab( syncW, qtr( "Synchronization" ) );
 
     if( module_Exists( p_intf, "v4l2" ) )
@@ -96,6 +96,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
         startPoint.setY( p_mi->y() + p_mi->frameGeometry().height() );
     }
     readSettings( "EPanel", QSize( 400, 280 ), startPoint );
+
+    CONNECT( THEMIM->getIM(), statusChanged( int ), this, changedItem( int ) );
+
 }
 
 ExtendedDialog::~ExtendedDialog()
@@ -103,3 +106,10 @@ ExtendedDialog::~ExtendedDialog()
     writeSettings( "EPanel" );
 }
 
+void ExtendedDialog::changedItem( int i_status )
+{
+    if( i_status != END_S ) return;
+    syncW->clean();
+    videoEffect->clean();
+    equal->clean();
+}
index 001ef887421713504dd5e4ccecff527031e92453..d57aaa27f791815e3d1266b46bddfc66aa9a2de4 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "util/qvlcframe.hpp"
 
+#include "components/extended_panels.hpp"
+
 class ExtendedDialog : public QVLCFrame
 {
     Q_OBJECT;
@@ -45,6 +47,12 @@ public:
 private:
     ExtendedDialog( intf_thread_t * );
     static ExtendedDialog *instance;
+    SyncControls *syncW;
+    ExtVideo *videoEffect;
+    Equalizer *equal;
+private slots:
+    void changedItem( int );
 };
 
 #endif
+