]> git.sesse.net Git - vlc/commitdiff
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 de481e4f83f2fbeca910176cdd3efccb18f2b39c..ba440d81ce009724a8e3dddb05f885d8c1042126 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 cfbb1c7aa61e119b7e3e2edf4f0a6bed71ff6390..0a57560b0ed4a077eb595e2ce14d6f4cc562b170 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;