flat_media_list_view.c: Add some debug facilities.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 31 Dec 2007 02:06:53 +0000 (02:06 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 31 Dec 2007 02:06:53 +0000 (02:06 +0000)
src/control/flat_media_list_view.c
src/control/media_list.c

index d6fc8bf..8d3e8a1 100644 (file)
@@ -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 );
index 8a10874..407ecf4 100644 (file)
@@ -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;