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()
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;
......
......@@ -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
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