+
+// Get all the callbacks
+static int AllCallback( vlc_object_t *p_this, const char *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ (void)p_this;
+ (void)oldval;
+ intf_thread_t *p_intf = (intf_thread_t*)p_data;
+
+ callback_info_t *info = malloc( sizeof( callback_info_t ) );
+ if( !info )
+ return VLC_ENOMEM;
+
+ // Wich event is it ?
+ if( !strcmp( "item-current", psz_var ) )
+ info->signal = SIGNAL_ITEM_CURRENT;
+ else if( !strcmp( "intf-change", psz_var ) )
+ info->signal = SIGNAL_INTF_CHANGE;
+ else if( !strcmp( "playlist-item-append", psz_var ) )
+ {
+ info->signal = SIGNAL_PLAYLIST_ITEM_APPEND;
+ info->i_node = ((playlist_add_t*)newval.p_address)->i_node;
+ }
+ else if( !strcmp( "playlist-item-deleted", psz_var ) )
+ info->signal = SIGNAL_PLAYLIST_ITEM_DELETED;
+ else if( !strcmp( "random", psz_var ) )
+ info->signal = SIGNAL_RANDOM;
+ else if( !strcmp( "repeat", psz_var ) )
+ info->signal = SIGNAL_REPEAT;
+ else if( !strcmp( "loop", psz_var ) )
+ info->signal = SIGNAL_LOOP;
+ else if( !strcmp( "state", psz_var ) )
+ {
+ info->signal = SIGNAL_STATE;
+ info->i_input_state = newval.i_int;
+ }
+ else
+ assert(0);
+
+ // Append the event
+ vlc_mutex_lock( &p_intf->p_sys->lock );
+ vlc_array_append( p_intf->p_sys->p_events, info );
+ vlc_mutex_unlock( &p_intf->p_sys->lock );
+ return VLC_SUCCESS;
+}
+