[vlc-devel] commit: Qt: Change the rate scale in order to have 0. 96x in the slider in order to help people who want to fix NTSC/PAL issues. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Tue Dec 30 13:21:09 CET 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Dec 29 12:54:58 2008 +0100| [dcaffea5cd8f45c8a1e4cf5b23d5638a6b77c0e8] | committer: Jean-Baptiste Kempf
Qt: Change the rate scale in order to have 0.96x in the slider in order to help people who want to fix NTSC/PAL issues.
Also remove lots of includes.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dcaffea5cd8f45c8a1e4cf5b23d5638a6b77c0e8
---
modules/gui/qt4/components/interface_widgets.cpp | 37 ++++++++-------------
modules/gui/qt4/components/interface_widgets.hpp | 26 +++++++++------
2 files changed, 29 insertions(+), 34 deletions(-)
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 99a600c..e0fd180 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -1,7 +1,7 @@
/*****************************************************************************
* interface_widgets.cpp : Custom widgets for the main interface
****************************************************************************
- * Copyright ( C ) 2006 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub at videolan.org>
@@ -28,23 +28,15 @@
# include "config.h"
#endif
-#include <vlc_vout.h>
-
-#include "dialogs_provider.hpp"
#include "components/interface_widgets.hpp"
-#include "main_interface.hpp"
-#include "input_manager.hpp"
-#include "menus.hpp"
-#include "util/input_slider.hpp"
-#include "util/customwidgets.hpp"
+
+#include "input_manager.hpp" /* Rate control */
+#include "menus.hpp" /* Popup menu on bgWidget */
+
+#include <vlc_vout.h>
#include <QLabel>
-#include <QSpacerItem>
-#include <QCursor>
-#include <QPushButton>
#include <QToolButton>
-#include <QHBoxLayout>
-#include <QMenu>
#include <QPalette>
#include <QResizeEvent>
#include <QDate>
@@ -56,8 +48,6 @@
#include <math.h>
-#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
-
/**********************************************************************
* Video Widget. A simple frame on which video is drawn
* This class handles resize issues
@@ -238,6 +228,9 @@ void BackgroundWidget::contextMenuEvent( QContextMenuEvent *event )
}
#if 0
+#include <QPushButton>
+#include <QHBoxLayout>
+
/**********************************************************************
* Visualization selector panel
**********************************************************************/
@@ -304,10 +297,10 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) :
speedSlider->setOrientation( Qt::Vertical );
speedSlider->setTickPosition( QSlider::TicksRight );
- speedSlider->setRange( -24, 24 );
+ speedSlider->setRange( -34, 34 );
speedSlider->setSingleStep( 1 );
speedSlider->setPageStep( 1 );
- speedSlider->setTickInterval( 12 );
+ speedSlider->setTickInterval( 17 );
CONNECT( speedSlider, valueChanged( int ), this, updateRate( int ) );
@@ -343,7 +336,7 @@ void SpeedControlWidget::updateControls( int rate )
return;
}
- double value = 12 * log( (double)INPUT_RATE_DEFAULT / rate ) / log( 2 );
+ double value = 17 * log( (double)INPUT_RATE_DEFAULT / rate ) / log( 2 );
int sliderValue = (int) ( ( value > 0 ) ? value + .5 : value - .5 );
if( sliderValue < speedSlider->minimum() )
@@ -363,7 +356,7 @@ void SpeedControlWidget::updateControls( int rate )
void SpeedControlWidget::updateRate( int sliderValue )
{
- double speed = pow( 2, (double)sliderValue / 12 );
+ double speed = pow( 2, (double)sliderValue / 17 );
int rate = INPUT_RATE_DEFAULT / speed;
THEMIM->getIM()->setRate(rate);
@@ -371,11 +364,9 @@ void SpeedControlWidget::updateRate( int sliderValue )
void SpeedControlWidget::resetRate()
{
- THEMIM->getIM()->setRate(INPUT_RATE_DEFAULT);
+ THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
}
-
-
static int downloadCoverCallback( vlc_object_t *p_this,
char const *psz_var,
vlc_value_t oldvar, vlc_value_t newvar,
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 607924b..f042806 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -1,7 +1,7 @@
/*****************************************************************************
* interface_widgets.hpp : Custom widgets for the main interface
****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub at videolan.org>
@@ -30,16 +30,14 @@
# include "config.h"
#endif
-#include <vlc_common.h>
-#include <vlc_interface.h>
-//#include <vlc_aout.h> Visualizer
-
-#include "qt4.hpp"
#include "main_interface.hpp"
#include "input_manager.hpp"
+
#include "components/controller.hpp"
#include "components/controller_widget.hpp"
+//#include <vlc_aout.h> Visualizer
+
#include <QWidget>
#include <QFrame>
#include <QLabel>
@@ -155,7 +153,7 @@ class SpeedLabel : public QLabel
{
Q_OBJECT
public:
- SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text)
+ SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text )
{ p_intf = _p_intf; }
protected:
@@ -178,8 +176,10 @@ public:
private:
intf_thread_t *p_intf;
QSlider *speedSlider;
+
public slots:
void setEnable( bool );
+
private slots:
void updateRate( int );
void resetRate();
@@ -193,18 +193,22 @@ public:
vlc_object_t *p_this,
input_item_t *p_input = NULL );
virtual ~CoverArtLabel()
- { if( p_input ) vlc_gc_decref( p_input ); };
+ { if( p_input ) vlc_gc_decref( p_input ); }
private:
input_item_t *p_input;
vlc_object_t *p_this;
+
QString prevArt;
public slots:
void requestUpdate() { emit updateRequested(); };
void update( input_item_t* p_item )
- { if( p_input ) vlc_gc_decref( p_input );
- if( ( p_input = p_item ) ) vlc_gc_incref( p_input );
- requestUpdate(); }
+ {
+ if( p_input ) vlc_gc_decref( p_input );
+ if( ( p_input = p_item ) )
+ vlc_gc_incref( p_input );
+ requestUpdate();
+ }
private slots:
void doUpdate();
More information about the vlc-devel
mailing list