Commit 7a8ee109 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - UpdateArt separation from other functions in the IM.

parent 527187a0
...@@ -148,7 +148,7 @@ void InputManager::delCallbacks() ...@@ -148,7 +148,7 @@ void InputManager::delCallbacks()
void InputManager::customEvent( QEvent *event ) void InputManager::customEvent( QEvent *event )
{ {
int type = event->type(); 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 && if ( type != PositionUpdate_Type &&
type != ItemChanged_Type && type != ItemChanged_Type &&
type != ItemRateChanged_Type && type != ItemRateChanged_Type &&
...@@ -172,6 +172,7 @@ void InputManager::customEvent( QEvent *event ) ...@@ -172,6 +172,7 @@ void InputManager::customEvent( QEvent *event )
case ItemChanged_Type: case ItemChanged_Type:
UpdateMeta(); UpdateMeta();
UpdateTitle(); UpdateTitle();
UpdateArt();
break; break;
case ItemRateChanged_Type: case ItemRateChanged_Type:
UpdateRate(); UpdateRate();
...@@ -185,7 +186,7 @@ void InputManager::customEvent( QEvent *event ) ...@@ -185,7 +186,7 @@ void InputManager::customEvent( QEvent *event )
} }
} }
void InputManager::UpdatePosition( void ) void InputManager::UpdatePosition()
{ {
/* Update position */ /* Update position */
int i_length, i_time; /* Int is enough, since we store seconds */ int i_length, i_time; /* Int is enough, since we store seconds */
...@@ -196,7 +197,7 @@ void InputManager::UpdatePosition( void ) ...@@ -196,7 +197,7 @@ void InputManager::UpdatePosition( void )
emit positionUpdated( f_pos, i_time, i_length ); emit positionUpdated( f_pos, i_time, i_length );
} }
void InputManager::UpdateTitle( void ) void InputManager::UpdateTitle()
{ {
/* Update navigation status */ /* Update navigation status */
vlc_value_t val; val.i_int = 0; vlc_value_t val; val.i_int = 0;
...@@ -213,7 +214,7 @@ void InputManager::UpdateTitle( void ) ...@@ -213,7 +214,7 @@ void InputManager::UpdateTitle( void )
} }
} }
void InputManager::UpdateStatus( void ) void InputManager::UpdateStatus()
{ {
/* Update playing status */ /* Update playing status */
vlc_value_t val; val.i_int = 0; vlc_value_t val; val.i_int = 0;
...@@ -225,7 +226,7 @@ void InputManager::UpdateStatus( void ) ...@@ -225,7 +226,7 @@ void InputManager::UpdateStatus( void )
} }
} }
void InputManager::UpdateRate( void ) void InputManager::UpdateRate()
{ {
/* Update Rate */ /* Update Rate */
int i_new_rate = var_GetInteger( p_input, "rate"); int i_new_rate = var_GetInteger( p_input, "rate");
...@@ -237,7 +238,7 @@ void InputManager::UpdateRate( void ) ...@@ -237,7 +238,7 @@ void InputManager::UpdateRate( void )
} }
} }
void InputManager::UpdateMeta( void ) void InputManager::UpdateMeta()
{ {
/* Update text, name and nowplaying */ /* Update text, name and nowplaying */
QString text; QString text;
...@@ -277,17 +278,6 @@ void InputManager::UpdateMeta( void ) ...@@ -277,17 +278,6 @@ void InputManager::UpdateMeta( void )
old_name=text; 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 ? */ /* Has Audio, has Video Tracks ? */
vlc_value_t val; vlc_value_t val;
var_Change( p_input, "audio-es", VLC_VAR_CHOICESCOUNT, &val, NULL ); var_Change( p_input, "audio-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
...@@ -302,6 +292,21 @@ void InputManager::UpdateMeta( void ) ...@@ -302,6 +292,21 @@ void InputManager::UpdateMeta( void )
#endif #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 */ /* User update of the slider */
void InputManager::sliderUpdate( float new_pos ) void InputManager::sliderUpdate( float new_pos )
{ {
...@@ -460,7 +465,7 @@ MainInputManager::~MainInputManager() ...@@ -460,7 +465,7 @@ MainInputManager::~MainInputManager()
void MainInputManager::customEvent( QEvent *event ) void MainInputManager::customEvent( QEvent *event )
{ {
int type = event->type(); 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 ) if ( type != ItemChanged_Type && type != VolumeChanged_Type )
return; return;
......
...@@ -65,13 +65,14 @@ public: ...@@ -65,13 +65,14 @@ public:
bool b_has_audio, b_has_video, b_had_audio, b_had_video; bool b_has_audio, b_has_video, b_had_audio, b_had_video;
private: private:
void customEvent( QEvent * ); void customEvent( QEvent * );
void addCallbacks( void ); void addCallbacks();
void delCallbacks( void ); void delCallbacks();
void UpdateRate( void ); void UpdateRate();
void UpdateMeta( void ); void UpdateMeta();
void UpdateStatus( void ); void UpdateStatus();
void UpdateTitle( void ); void UpdateTitle();
void UpdatePosition( void ); void UpdatePosition();
void UpdateArt();
intf_thread_t *p_intf; intf_thread_t *p_intf;
input_thread_t *p_input; input_thread_t *p_input;
int i_old_playing_status; int i_old_playing_status;
...@@ -144,7 +145,7 @@ private slots: ...@@ -144,7 +145,7 @@ private slots:
//void updateInput(); //void updateInput();
signals: signals:
void inputChanged( input_thread_t * ); void inputChanged( input_thread_t * );
void volumeChanged( void ); void volumeChanged();
}; };
#endif #endif
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