Commit a8365c23 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Fix previous commits.

parent 1182a557
...@@ -251,11 +251,10 @@ void InputManager::UpdateMeta( void ) ...@@ -251,11 +251,10 @@ void InputManager::UpdateMeta( void )
{ {
text.sprintf( "%s - %s", psz_artist, psz_name ); text.sprintf( "%s - %s", psz_artist, psz_name );
} }
free( psz_artist ); else
} {
else text.sprintf( "%s", psz_name );
{ } free( psz_artist );
text.sprintf( "%s", psz_name );
} }
free( psz_name ); free( psz_name );
free( psz_nowplaying ); free( psz_nowplaying );
...@@ -405,9 +404,9 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL), ...@@ -405,9 +404,9 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL),
p_input = NULL; p_input = NULL;
im = new InputManager( this, p_intf ); im = new InputManager( this, p_intf );
var_AddCallback( THEPL, "playlist-current", ItemChanged, this ); var_AddCallback( THEPL, "playlist-current", ItemChanged, im );
var_AddCallback( THEPL, "intf-change", ItemChanged, this );
var_AddCallback( THEPL, "playlist-current", InputChanged, this ); var_AddCallback( THEPL, "playlist-current", InputChanged, this );
var_AddCallback( THEPL, "intf-change", ItemChanged, this );
var_AddCallback( THEPL, "activity", InputChanged, this ); var_AddCallback( THEPL, "activity", InputChanged, this );
/* src/input/input.c:2076*/ /* src/input/input.c:2076*/
var_AddCallback( THEPL, "item-change", ItemChanged, this ); var_AddCallback( THEPL, "item-change", ItemChanged, this );
...@@ -436,8 +435,8 @@ MainInputManager::~MainInputManager() ...@@ -436,8 +435,8 @@ MainInputManager::~MainInputManager()
void MainInputManager::customEvent( QEvent *event ) void MainInputManager::customEvent( QEvent *event )
{ {
msg_Dbg( p_intf, "New Event" );
int type = event->type(); int type = event->type();
msg_Dbg( p_intf, "New MIM Event, type: %i", type );
if ( type != ItemChanged_Type && type != VolumeChanged_Type ) if ( type != ItemChanged_Type && type != VolumeChanged_Type )
return; return;
...@@ -447,6 +446,7 @@ void MainInputManager::customEvent( QEvent *event ) ...@@ -447,6 +446,7 @@ void MainInputManager::customEvent( QEvent *event )
return; return;
} }
/* Should be ItemChanged */
if( VLC_OBJECT_INTF == p_intf->i_object_type ) if( VLC_OBJECT_INTF == p_intf->i_object_type )
{ {
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
...@@ -474,7 +474,8 @@ void MainInputManager::customEvent( QEvent *event ) ...@@ -474,7 +474,8 @@ void MainInputManager::customEvent( QEvent *event )
} }
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
} }
else { else
{
/* we are working as a dialogs provider */ /* we are working as a dialogs provider */
playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_intf, playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
...@@ -512,7 +513,9 @@ void MainInputManager::togglePlayPause() ...@@ -512,7 +513,9 @@ void MainInputManager::togglePlayPause()
getIM()->togglePlayPause(); getIM()->togglePlayPause();
} }
/* Static functions */ /* Static callbacks */
/* IM */
static int InterfaceChanged( vlc_object_t *p_this, const char *psz_var, static int InterfaceChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param ) vlc_value_t oldval, vlc_value_t newval, void *param )
{ {
...@@ -557,26 +560,6 @@ static int ItemTitleChanged( vlc_object_t *p_this, const char *psz_var, ...@@ -557,26 +560,6 @@ static int ItemTitleChanged( vlc_object_t *p_this, const char *psz_var,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int InputChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
MainInputManager *im = (MainInputManager*)param;
IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
QApplication::postEvent( im, static_cast<QEvent*>(event) );
return VLC_SUCCESS;
}
static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
MainInputManager *im = (MainInputManager*)param;
IMEvent *event = new IMEvent( VolumeChanged_Type, newval.i_int );
QApplication::postEvent( im, static_cast<QEvent*>(event) );
return VLC_SUCCESS;
}
static int ItemChanged( vlc_object_t *p_this, const char *psz_var, static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param ) vlc_value_t oldval, vlc_value_t newval, void *param )
{ {
...@@ -587,6 +570,7 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var, ...@@ -587,6 +570,7 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int ChangeAudio( vlc_object_t *p_this, const char *var, vlc_value_t o, static int ChangeAudio( vlc_object_t *p_this, const char *var, vlc_value_t o,
vlc_value_t n, void *param ) vlc_value_t n, void *param )
{ {
...@@ -603,3 +587,24 @@ static int ChangeVideo( vlc_object_t *p_this, const char *var, vlc_value_t o, ...@@ -603,3 +587,24 @@ static int ChangeVideo( vlc_object_t *p_this, const char *var, vlc_value_t o,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
/* MIM */
static int InputChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
MainInputManager *im = (MainInputManager*)param;
IMEvent *event = new IMEvent( ItemChanged_Type, newval.i_int );
QApplication::postEvent( im, static_cast<QEvent*>(event) );
return VLC_SUCCESS;
}
static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
MainInputManager *im = (MainInputManager*)param;
IMEvent *event = new IMEvent( VolumeChanged_Type, newval.i_int );
QApplication::postEvent( im, static_cast<QEvent*>(event) );
return VLC_SUCCESS;
}
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