]> git.sesse.net Git - vlc/commitdiff
Qt4 - UpdateArt separation from other functions in the IM.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 31 Jan 2008 04:46:17 +0000 (04:46 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 31 Jan 2008 04:46:17 +0000 (04:46 +0000)
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp

index 521ff3c9de7d1f3a655dec0417e3e191fc7632d7..7ad65e74c47d8f4d8ee86a33f19b612ed6360ce2 100644 (file)
@@ -148,7 +148,7 @@ void InputManager::delCallbacks()
 void InputManager::customEvent( QEvent *event )
 {
     int type = event->type();
-    msg_Dbg( p_intf, "New IM Event of type: %i", type );
+    //msg_Dbg( p_intf, "New IM Event of type: %i", type );
     if ( type != PositionUpdate_Type &&
          type != ItemChanged_Type &&
          type != ItemRateChanged_Type &&
@@ -172,6 +172,7 @@ void InputManager::customEvent( QEvent *event )
     case ItemChanged_Type:
         UpdateMeta();
         UpdateTitle();
+        UpdateArt();
         break;
     case ItemRateChanged_Type:
         UpdateRate();
@@ -185,7 +186,7 @@ void InputManager::customEvent( QEvent *event )
     }
 }
 
-void InputManager::UpdatePosition( void )
+void InputManager::UpdatePosition()
 {
      /* Update position */
      int i_length, i_time; /* Int is enough, since we store seconds */
@@ -196,7 +197,7 @@ void InputManager::UpdatePosition( void )
      emit positionUpdated( f_pos, i_time, i_length );
 }
 
-void InputManager::UpdateTitle( void )
+void InputManager::UpdateTitle()
 {
      /* Update navigation status */
      vlc_value_t val; val.i_int = 0;
@@ -213,7 +214,7 @@ void InputManager::UpdateTitle( void )
      }
 }
 
-void InputManager::UpdateStatus( void )
+void InputManager::UpdateStatus()
 {
      /* Update playing status */
      vlc_value_t val; val.i_int = 0;
@@ -225,7 +226,7 @@ void InputManager::UpdateStatus( void )
      }
 }
 
-void InputManager::UpdateRate( void )
+void InputManager::UpdateRate()
 {
      /* Update Rate */
      int i_new_rate = var_GetInteger( p_input, "rate");
@@ -237,7 +238,7 @@ void InputManager::UpdateRate( void )
      }
 }
 
-void InputManager::UpdateMeta( void )
+void InputManager::UpdateMeta()
 {
     /* Update text, name and nowplaying */
     QString text;
@@ -277,17 +278,6 @@ void InputManager::UpdateMeta( void )
         old_name=text;
     }
 
-    /* Update Art meta */
-    QString url;
-    char *psz_art = input_item_GetArtURL( input_GetItem( p_input ) );
-    url.sprintf("%s", psz_art );
-    free( psz_art );
-    if( artUrl != url )
-    {
-        artUrl = url.replace( "file://",QString("" ) );
-        emit artChanged( artUrl );
-    }
-
     /* Has Audio, has Video Tracks ? */
     vlc_value_t val;
     var_Change( p_input, "audio-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
@@ -302,6 +292,21 @@ void InputManager::UpdateMeta( void )
 #endif
 }
 
+void UpdateArt()
+{
+    /* Update Art meta */
+    QString url;
+    char *psz_art = input_item_GetArtURL( input_GetItem( p_input ) );
+    url.sprintf("%s", psz_art );
+    free( psz_art );
+    if( artUrl != url )
+    {
+        artUrl = url.replace( "file://",QString("" ) );
+        emit artChanged( artUrl );
+        msg_Dbg( p_intf, "Art:  %s", qtu( artUrl ) );
+    }
+}
+
 /* User update of the slider */
 void InputManager::sliderUpdate( float new_pos )
 {
@@ -460,7 +465,7 @@ MainInputManager::~MainInputManager()
 void MainInputManager::customEvent( QEvent *event )
 {
     int type = event->type();
-    msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
+    //msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
     if ( type != ItemChanged_Type && type != VolumeChanged_Type )
         return;
 
index 02d7a796008f5dc53df210f5c1a35244fc30f641..e7c371b425724f20cf49de07c865f44505a081e0 100644 (file)
@@ -65,13 +65,14 @@ public:
     bool b_has_audio, b_has_video, b_had_audio, b_had_video;
 private:
     void customEvent( QEvent * );
-    void addCallbacks( void );
-    void delCallbacks( void );
-    void UpdateRate( void );
-    void UpdateMeta( void );
-    void UpdateStatus( void );
-    void UpdateTitle( void );
-    void UpdatePosition( void );
+    void addCallbacks();
+    void delCallbacks();
+    void UpdateRate();
+    void UpdateMeta();
+    void UpdateStatus();
+    void UpdateTitle();
+    void UpdatePosition();
+    void UpdateArt();
     intf_thread_t  *p_intf;
     input_thread_t *p_input;
     int             i_old_playing_status;
@@ -144,7 +145,7 @@ private slots:
     //void updateInput();
 signals:
     void inputChanged( input_thread_t * );
-    void volumeChanged( void );
+    void volumeChanged();
 };
 
 #endif