Qt4 - Volume Icon updates NOT in an TIMEOUT function, which is called very often...
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Sep 2007 00:59:44 +0000 (00:59 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Sep 2007 00:59:44 +0000 (00:59 +0000)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp

index de481e4..ba440d8 100644 (file)
@@ -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() );
index cfbb1c7..0a57560 100644 (file)
@@ -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;