]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/input_manager.cpp
Qt: Do not show a progressDialogBar for too short a time.
[vlc] / modules / gui / qt4 / input_manager.cpp
index a648febfe7c932718cc28505650738af0d1877df..b5058e1ef7be08c8fa5bfb939a9efad152bde8f8 100644 (file)
@@ -79,7 +79,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
     artUrl       = "";
     p_input      = NULL;
     p_input_vbi  = NULL;
-    i_rate       = 0;
+    f_rate       = 0;
     p_item       = NULL;
     b_video      = false;
     timeA        = 0;
@@ -103,21 +103,23 @@ void InputManager::setInput( input_thread_t *_p_input )
     {
         msg_Dbg( p_intf, "IM: Setting an input" );
         vlc_object_hold( p_input );
-        emit statusChanged( PLAYING_S );
+        addCallbacks();
+        UpdateStatus();
         UpdateName();
         UpdateArt();
         UpdateTeletext();
         UpdateNavigation();
         UpdateVout();
-        addCallbacks();
+
         p_item = input_GetItem( p_input );
+        emit rateChanged( var_GetFloat( p_input, "rate" ) );
     }
     else
     {
         p_input = NULL;
         p_item = NULL;
         assert( !p_input_vbi );
-        emit rateChanged( INPUT_RATE_DEFAULT );
+        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
     }
 }
 
@@ -148,7 +150,7 @@ void InputManager::delInput()
     p_input = NULL;
 
     emit positionUpdated( -1.0, 0 ,0 );
-    emit rateChanged( INPUT_RATE_DEFAULT ); /* TODO: Do we want this ? */
+    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
     emit nameChanged( "" );
     emit chapterChanged( 0 );
     emit titleChanged( 0 );
@@ -430,12 +432,12 @@ void InputManager::UpdateStatus()
 void InputManager::UpdateRate()
 {
     /* Update Rate */
-    int i_new_rate = INPUT_RATE_DEFAULT / var_GetFloat( p_input, "rate" );
-    if( i_new_rate != i_rate )
+    float f_new_rate = var_GetFloat( p_input, "rate" );
+    if( f_new_rate != f_rate )
     {
-        i_rate = i_new_rate;
+        f_rate = f_new_rate;
         /* Update rate */
-        emit rateChanged( i_rate );
+        emit rateChanged( f_rate );
     }
 }
 
@@ -587,7 +589,7 @@ void InputManager::UpdateCaching()
     if( f_newCache != f_cache )
     {
         f_cache = f_newCache;
-        /* Update rate */
+        /* Update cache */
         emit cachingChanged( f_cache );
     }
 }
@@ -694,7 +696,6 @@ void InputManager::togglePlayPause()
         int state = var_GetInteger( p_input, "state" );
         state = ( state != PLAYING_S ) ? PLAYING_S : PAUSE_S;
         var_SetInteger( p_input, "state", state );
-        emit statusChanged( state );
     }
 }
 
@@ -1102,8 +1103,8 @@ void MainInputManager::toggleRandom()
 
 void MainInputManager::notifyRepeatLoop()
 {
-    int i_value = var_GetBool( THEPL, "loop" ) * REPEAT_ONE
-              + var_GetBool( THEPL, "repeat" ) * REPEAT_ALL;
+    int i_value = var_GetBool( THEPL, "loop" ) * REPEAT_ALL
+              + var_GetBool( THEPL, "repeat" ) * REPEAT_ONE;
 
     emit repeatLoopChanged( i_value );
 }