{
text.sprintf( "%s - %s", psz_artist, psz_name );
}
- free( psz_artist );
- }
- else
- {
- text.sprintf( "%s", psz_name );
+ else
+ {
+ text.sprintf( "%s", psz_name );
+ } free( psz_artist );
}
free( psz_name );
free( psz_nowplaying );
p_input = NULL;
im = new InputManager( this, p_intf );
- var_AddCallback( THEPL, "playlist-current", ItemChanged, this );
- var_AddCallback( THEPL, "intf-change", ItemChanged, this );
+ var_AddCallback( THEPL, "playlist-current", ItemChanged, im );
var_AddCallback( THEPL, "playlist-current", InputChanged, this );
+ var_AddCallback( THEPL, "intf-change", ItemChanged, this );
var_AddCallback( THEPL, "activity", InputChanged, this );
/* src/input/input.c:2076*/
var_AddCallback( THEPL, "item-change", ItemChanged, this );
void MainInputManager::customEvent( QEvent *event )
{
- msg_Dbg( p_intf, "New Event" );
int type = event->type();
+ msg_Dbg( p_intf, "New MIM Event, type: %i", type );
if ( type != ItemChanged_Type && type != VolumeChanged_Type )
return;
return;
}
+ /* Should be ItemChanged */
if( VLC_OBJECT_INTF == p_intf->i_object_type )
{
vlc_mutex_lock( &p_intf->change_lock );
}
vlc_mutex_unlock( &p_intf->change_lock );
}
- else {
+ else
+ {
/* we are working as a dialogs provider */
playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
getIM()->togglePlayPause();
}
-/* Static functions */
+/* Static callbacks */
+
+/* IM */
static int InterfaceChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
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,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
return VLC_SUCCESS;
}
+
static int ChangeAudio( vlc_object_t *p_this, const char *var, vlc_value_t o,
vlc_value_t n, void *param )
{
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;
+}
+