[vlc-commits] gui: qt: use float for rate

Thomas Guillem git at videolan.org
Fri Feb 15 16:38:08 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb 15 16:05:56 2019 +0100| [49971bfc9b275cf12f39c65963e0cb5972fc852c] | committer: Thomas Guillem

gui: qt: use float for rate

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

 modules/gui/qt/components/interface_widgets.cpp | 5 ++---
 modules/gui/qt/input_manager.cpp                | 5 ++---
 modules/gui/qt/input_manager.hpp                | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index 96d71109ea..e736a20d12 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -802,9 +802,8 @@ void SpeedControlWidget::updateRate( int sliderValue )
     lastValue = sliderValue;
 
     double speed = pow( 2, (double)sliderValue / 17 );
-    int rate = INPUT_RATE_DEFAULT / speed;
 
-    THEMIM->getIM()->setRate(rate);
+    THEMIM->getIM()->setRate(speed);
     //spinBox->setValue( var_InheritFloat( THEPL, "rate" ) );
 }
 
@@ -815,7 +814,7 @@ void SpeedControlWidget::updateSpinBoxRate( double r )
 
 void SpeedControlWidget::resetRate()
 {
-    THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
+    THEMIM->getIM()->setRate( 1.0f );
 }
 
 CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 10ba109dba..fdb11dae2a 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -909,10 +909,9 @@ void InputManager::normalRate()
     var_SetFloat( THEPL, "rate", 1. );
 }
 
-void InputManager::setRate( int new_rate )
+void InputManager::setRate( float new_rate )
 {
-    var_SetFloat( THEPL, "rate",
-                 (float)INPUT_RATE_DEFAULT / (float)new_rate );
+    var_SetFloat( THEPL, "rate", new_rate );
 }
 
 void InputManager::jumpFwd()
diff --git a/modules/gui/qt/input_manager.hpp b/modules/gui/qt/input_manager.hpp
index 119f5e54c3..eece06e13d 100644
--- a/modules/gui/qt/input_manager.hpp
+++ b/modules/gui/qt/input_manager.hpp
@@ -192,7 +192,7 @@ public slots:
     void littlefaster();
     void littleslower();
     void normalRate();
-    void setRate( int );
+    void setRate( float );
     /* Jumping */
     void jumpFwd();
     void jumpBwd();



More information about the vlc-commits mailing list