Commit dcaffea5 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Qt: Change the rate scale in order to have 0.96x in the slider in order to...


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's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4cca7c8a
/*****************************************************************************
* 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@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,
......
/*****************************************************************************
* 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@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();
......
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