[vlc-devel] commit: Fix the reminiscence of some extended settings and work-around the lack of persistence of Equalizer settins between songs by deactiving the UI . At least it is consistent. (Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Aug 25 16:02:06 CEST 2008


vlc | branch: 0.9-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Sun Aug 24 18:49:39 2008 -0700| [819ead88b83f6c76674304530d2e623e1f302f45] | committer: Christophe Mutricy 

Fix the reminiscence of some extended settings and work-around the lack of persistence of Equalizer settins between songs by deactiving the UI. At least it is consistent.

Ref #1752 and complaints on IRC. #1866 and #1795
(cherry picked from commit 420ecd549ccf5f986708ddd783bb06473ebd31c5)

Signed-off-by: Christophe Mutricy <xtophe at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=819ead88b83f6c76674304530d2e623e1f302f45
---

 modules/gui/qt4/components/extended_panels.cpp |   20 ++++++++++++++++++++
 modules/gui/qt4/components/extended_panels.hpp |   22 ++++++----------------
 modules/gui/qt4/dialogs/extended.cpp           |   20 +++++++++++++++-----
 modules/gui/qt4/dialogs/extended.hpp           |    8 ++++++++
 4 files changed, 49 insertions(+), 21 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 49b0681..8accbf9 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -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;
diff --git a/modules/gui/qt4/components/extended_panels.hpp b/modules/gui/qt4/components/extended_panels.hpp
index fd56a25..aaffd02 100644
--- a/modules/gui/qt4/components/extended_panels.hpp
+++ b/modules/gui/qt4/components/extended_panels.hpp
@@ -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:
diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp
index c02dcc1..d771f45 100644
--- a/modules/gui/qt4/dialogs/extended.cpp
+++ b/modules/gui/qt4/dialogs/extended.cpp
@@ -27,10 +27,10 @@
 
 #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();
+}
diff --git a/modules/gui/qt4/dialogs/extended.hpp b/modules/gui/qt4/dialogs/extended.hpp
index 001ef88..d57aaa2 100644
--- a/modules/gui/qt4/dialogs/extended.hpp
+++ b/modules/gui/qt4/dialogs/extended.hpp
@@ -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
+




More information about the vlc-devel mailing list