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 )
( 2*volumeSlider->maximum() );
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()
......@@ -578,12 +583,7 @@ void ControlsWidget::updateOnTimer()
volumeSlider->setValue( i_volume );
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 */
enableInput( THEMIM->getIM()->hasInput() );
//enableVideo( THEMIM->getIM()->hasVideo() );
......
......@@ -186,6 +186,9 @@ public:
if (e->type() == QEvent::MouseButtonPress )
{
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 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