Commit 0dbfd625 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

flat_media_list_view.c: Add some debug facilities.

parent 9d7bb46d
......@@ -52,6 +52,8 @@ ml_item_added( const libvlc_event_t * p_event, libvlc_media_list_view_t * p_mlv
int index = vlc_array_count( &p_mlv->p_this_view_data->array );
libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_added.item;
libvlc_media_descriptor_retain( p_md );
trace("appending item at index %d\n", index);
libvlc_media_list_view_will_add_item( p_mlv, p_md, index );
vlc_array_append( &p_mlv->p_this_view_data->array, p_md );
libvlc_media_list_view_item_added( p_mlv, p_md, index );
......
......@@ -31,6 +31,14 @@ typedef enum EventPlaceInTime {
EventDidHappen
} EventPlaceInTime;
//#define DEBUG_MEDIA_LIST
#ifdef DEBUG_MEDIA_LIST
# define trace( fmt, ... ) printf( "%s(): " fmt, __FUNCTION__, ##__VA_ARGS__ )
#else
# define trace( ... )
#endif
/*
* Private functions
*/
......@@ -53,6 +61,7 @@ notify_item_addition( libvlc_media_list_t * p_mlist,
/* Construct the event */
if( event_status == EventDidHappen )
{
trace("item was added at index %d\n", index);
event.type = libvlc_MediaListItemAdded;
event.u.media_list_item_added.item = p_md;
event.u.media_list_item_added.index = index;
......@@ -84,6 +93,7 @@ notify_item_deletion( libvlc_media_list_t * p_mlist,
/* Construct the event */
if( event_status == EventDidHappen )
{
trace("item at index %d was deleted\n", index);
event.type = libvlc_MediaListItemDeleted;
event.u.media_list_item_deleted.item = p_md;
event.u.media_list_item_deleted.index = index;
......
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