Commit 819ead88 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf Committed by Christophe Mutricy

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
(cherry picked from commit 420ecd54)
Signed-off-by: default avatarChristophe Mutricy <xtophe@videolan.org>
parent 4106fd11
......@@ -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;
......
......@@ -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:
......
......@@ -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();
}
......@@ -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
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