Commit 420ecd54 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Fix the reminiscence of some extended settings and work-around the lack of...

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
parent 0caa385c
...@@ -237,6 +237,14 @@ void ExtVideo::cropChange() ...@@ -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 ) void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
{ {
char *psz_parser, *psz_string; char *psz_parser, *psz_string;
...@@ -858,6 +866,11 @@ Equalizer::~Equalizer() ...@@ -858,6 +866,11 @@ Equalizer::~Equalizer()
{ {
} }
void Equalizer::clean()
{
ui.enableCheck->setChecked( false );
enable();
}
/* Write down initial values */ /* Write down initial values */
void Equalizer::updateUIFromCore() void Equalizer::updateUIFromCore()
{ {
...@@ -1361,6 +1374,13 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -1361,6 +1374,13 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
update(); update();
} }
void SyncControls::clean()
{
AVSpin->setValue( 0.0 );
subsSpin->setValue( 0.0 );
subSpeedSpin->setValue( 1.0 );
}
void SyncControls::update() void SyncControls::update()
{ {
int64_t i_delay; int64_t i_delay;
......
...@@ -48,6 +48,7 @@ class QSignalMapper; ...@@ -48,6 +48,7 @@ class QSignalMapper;
class ExtVideo: public QObject class ExtVideo: public QObject
{ {
Q_OBJECT Q_OBJECT
friend class ExtendedDialog;
public: public:
ExtVideo( intf_thread_t *, QTabWidget * ); ExtVideo( intf_thread_t *, QTabWidget * );
virtual ~ExtVideo(); virtual ~ExtVideo();
...@@ -60,6 +61,7 @@ private: ...@@ -60,6 +61,7 @@ private:
void initComboBoxItems( QObject* ); void initComboBoxItems( QObject* );
void setWidgetValue( QObject* ); void setWidgetValue( QObject* );
void ChangeVFiltersString( char *psz_name, bool b_add ); void ChangeVFiltersString( char *psz_name, bool b_add );
void clean();
private slots: private slots:
void updateFilters(); void updateFilters();
void updateFilterOptions(); void updateFilterOptions();
...@@ -89,6 +91,7 @@ private slots: ...@@ -89,6 +91,7 @@ private slots:
class Equalizer: public QWidget class Equalizer: public QWidget
{ {
Q_OBJECT Q_OBJECT
friend class ExtendedDialog;
public: public:
Equalizer( intf_thread_t *, QWidget * ); Equalizer( intf_thread_t *, QWidget * );
virtual ~Equalizer(); virtual ~Equalizer();
...@@ -105,6 +108,7 @@ private: ...@@ -105,6 +108,7 @@ private:
void addCallbacks( aout_instance_t * ); void addCallbacks( aout_instance_t * );
intf_thread_t *p_intf; intf_thread_t *p_intf;
void clean();
private slots: private slots:
void enable(bool); void enable(bool);
void enable(); void enable();
...@@ -141,25 +145,10 @@ private slots: ...@@ -141,25 +145,10 @@ private slots:
void setInitValues(); 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 class SyncControls : public QWidget
{ {
Q_OBJECT Q_OBJECT
friend class ExtendedDialog;
public: public:
SyncControls( intf_thread_t *, QWidget * ); SyncControls( intf_thread_t *, QWidget * );
virtual ~SyncControls() {}; virtual ~SyncControls() {};
...@@ -168,6 +157,7 @@ private: ...@@ -168,6 +157,7 @@ private:
QDoubleSpinBox *AVSpin; QDoubleSpinBox *AVSpin;
QDoubleSpinBox *subsSpin; QDoubleSpinBox *subsSpin;
QDoubleSpinBox *subSpeedSpin; QDoubleSpinBox *subSpeedSpin;
void clean();
public slots: public slots:
void update(); void update();
private slots: private slots:
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#include "dialogs/extended.hpp" #include "dialogs/extended.hpp"
#include "dialogs_provider.hpp" #include "dialogs_provider.hpp"
#include "components/extended_panels.hpp"
#include "main_interface.hpp" #include "main_interface.hpp"
#include "input_manager.hpp"
#include <QTabWidget> #include <QTabWidget>
#include <QGridLayout> #include <QGridLayout>
...@@ -53,7 +53,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -53,7 +53,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget ); QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget );
QTabWidget *audioTab = new QTabWidget( 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" ) ); audioTab->addTab( equal, qtr( "Graphic Equalizer" ) );
Spatializer *spatial = new Spatializer( p_intf, audioTab ); Spatializer *spatial = new Spatializer( p_intf, audioTab );
...@@ -67,13 +67,13 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -67,13 +67,13 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
QHBoxLayout *videoLayout = new QHBoxLayout( videoWidget ); QHBoxLayout *videoLayout = new QHBoxLayout( videoWidget );
QTabWidget *videoTab = new QTabWidget( videoWidget ); QTabWidget *videoTab = new QTabWidget( videoWidget );
ExtVideo *videoEffect = new ExtVideo( p_intf, videoTab ); videoEffect = new ExtVideo( p_intf, videoTab );
videoLayout->addWidget( videoTab ); videoLayout->addWidget( videoTab );
videoTab->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ); videoTab->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
mainTabW->addTab( videoWidget, qtr( "Video Effects" ) ); mainTabW->addTab( videoWidget, qtr( "Video Effects" ) );
SyncControls *syncW = new SyncControls( p_intf, videoTab ); syncW = new SyncControls( p_intf, videoTab );
mainTabW->addTab( syncW, qtr( "Synchronization" ) ); mainTabW->addTab( syncW, qtr( "Synchronization" ) );
if( module_Exists( p_intf, "v4l2" ) ) if( module_Exists( p_intf, "v4l2" ) )
...@@ -96,6 +96,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -96,6 +96,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
startPoint.setY( p_mi->y() + p_mi->frameGeometry().height() ); startPoint.setY( p_mi->y() + p_mi->frameGeometry().height() );
} }
readSettings( "EPanel", QSize( 400, 280 ), startPoint ); readSettings( "EPanel", QSize( 400, 280 ), startPoint );
CONNECT( THEMIM->getIM(), statusChanged( int ), this, changedItem( int ) );
} }
ExtendedDialog::~ExtendedDialog() ExtendedDialog::~ExtendedDialog()
...@@ -103,3 +106,10 @@ ExtendedDialog::~ExtendedDialog() ...@@ -103,3 +106,10 @@ ExtendedDialog::~ExtendedDialog()
writeSettings( "EPanel" ); writeSettings( "EPanel" );
} }
void ExtendedDialog::changedItem( int i_status )
{
if( i_status != END_S ) return;
syncW->clean();
videoEffect->clean();
equal->clean();
}
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "util/qvlcframe.hpp" #include "util/qvlcframe.hpp"
#include "components/extended_panels.hpp"
class ExtendedDialog : public QVLCFrame class ExtendedDialog : public QVLCFrame
{ {
Q_OBJECT; Q_OBJECT;
...@@ -45,6 +47,12 @@ public: ...@@ -45,6 +47,12 @@ public:
private: private:
ExtendedDialog( intf_thread_t * ); ExtendedDialog( intf_thread_t * );
static ExtendedDialog *instance; static ExtendedDialog *instance;
SyncControls *syncW;
ExtVideo *videoEffect;
Equalizer *equal;
private slots:
void changedItem( int );
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment