Commit a026aadb authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Volume Icon updates NOT in an TIMEOUT function, which is called very...

Qt4 - Volume Icon updates NOT in an TIMEOUT function, which is called very often. Redesign only when needed.
parent a4b6c379
...@@ -562,6 +562,11 @@ void ControlsWidget::updateVolume( int i_sliderVolume ) ...@@ -562,6 +562,11 @@ void ControlsWidget::updateVolume( int i_sliderVolume )
( 2*volumeSlider->maximum() ); ( 2*volumeSlider->maximum() );
aout_VolumeSet( p_intf, i_res ); aout_VolumeSet( p_intf, i_res );
} }
if( i_sliderVolume == 0 )
volMuteLabel->setPixmap( QPixmap(":/pixmaps/volume-muted.png" ) );
else if( i_sliderVolume < volumeSlider->maximum()/2 )
volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
} }
void ControlsWidget::updateOnTimer() void ControlsWidget::updateOnTimer()
...@@ -578,11 +583,6 @@ void ControlsWidget::updateOnTimer() ...@@ -578,11 +583,6 @@ void ControlsWidget::updateOnTimer()
volumeSlider->setValue( i_volume ); volumeSlider->setValue( i_volume );
b_my_volume = false; b_my_volume = false;
} }
if( i_volume == 0 )
volMuteLabel->setPixmap( QPixmap(":/pixmaps/volume-muted.png" ) );
else if( i_volume < volumeSlider->maximum()/2 )
volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
/* Activate the interface buttons according to the presence of the input */ /* Activate the interface buttons according to the presence of the input */
enableInput( THEMIM->getIM()->hasInput() ); enableInput( THEMIM->getIM()->hasInput() );
......
...@@ -186,6 +186,9 @@ public: ...@@ -186,6 +186,9 @@ public:
if (e->type() == QEvent::MouseButtonPress ) if (e->type() == QEvent::MouseButtonPress )
{ {
aout_VolumeMute( p_intf, NULL ); aout_VolumeMute( p_intf, NULL );
audio_volume_t i_volume;
aout_VolumeGet( p_intf, &i_volume );
m->updateVolume( i_volume * 200 /AOUT_VOLUME_MAX );
return true; return true;
} }
return false; return false;
......
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