Commit aa306dc6 authored by Laurent Aimar's avatar Laurent Aimar

Fixed potential infinite loop between input/qt4 regarding input speed.

and fixes for sure duplicated input speed settings done by qt4 when
changing rate.
parent b51afca9
...@@ -503,6 +503,8 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent ) ...@@ -503,6 +503,8 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent )
speedControlLayout->addWidget( speedSlider ); speedControlLayout->addWidget( speedSlider );
speedControlLayout->addWidget( normalSpeedButton ); speedControlLayout->addWidget( normalSpeedButton );
lastValue = 0;
activateOnState(); activateOnState();
} }
...@@ -530,12 +532,16 @@ void SpeedControlWidget::updateControls( float rate ) ...@@ -530,12 +532,16 @@ void SpeedControlWidget::updateControls( float rate )
{ {
sliderValue = speedSlider->maximum(); sliderValue = speedSlider->maximum();
} }
lastValue = sliderValue;
speedSlider->setValue( sliderValue ); speedSlider->setValue( sliderValue );
} }
void SpeedControlWidget::updateRate( int sliderValue ) void SpeedControlWidget::updateRate( int sliderValue )
{ {
if( sliderValue == lastValue )
return;
double speed = pow( 2, (double)sliderValue / 17 ); double speed = pow( 2, (double)sliderValue / 17 );
int rate = INPUT_RATE_DEFAULT / speed; int rate = INPUT_RATE_DEFAULT / speed;
......
...@@ -189,6 +189,7 @@ public: ...@@ -189,6 +189,7 @@ public:
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QSlider *speedSlider; QSlider *speedSlider;
int lastValue;
public slots: public slots:
void activateOnState(); void activateOnState();
......
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