Commit 8a99e94b authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Volume: if volume > 50% of the sliderBar, then show the highVolume Label.

parent b399b131
......@@ -468,7 +468,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
/* Volume */
VolumeClickHandler *h = new VolumeClickHandler( p_intf, this );
QLabel *volMuteLabel = new QLabel;
volMuteLabel = new QLabel;
volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
volMuteLabel->setToolTip( qtr( "Mute" ) );
volMuteLabel->installEventFilter( h );
......@@ -553,13 +553,16 @@ void ControlsWidget::setNavigation( int navigation )
}
static bool b_my_volume;
void ControlsWidget::updateVolume( int sliderVolume )
void ControlsWidget::updateVolume( int i_sliderVolume )
{
if( !b_my_volume )
{
int i_res = sliderVolume * AOUT_VOLUME_MAX /
int i_res = i_sliderVolume * AOUT_VOLUME_MAX /
( 2*volumeSlider->maximum() );
aout_VolumeSet( p_intf, i_res );
if( i_sliderVolume < volumeSlider->maximum()/2 )
volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
}
}
......
......@@ -155,6 +155,7 @@ private:
QPushButton *playButton, *fullscreenButton;
QPushButton *slowerButton, *fasterButton;
AdvControlsWidget *advControls;
QLabel *volMuteLabel;
bool b_advancedVisible;
private slots:
......
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