- event.type = libvlc_MediaListItemDeleted;
- event.u.media_list_item_deleted.item = p_md;
- event.u.media_list_item_deleted.index = index;
-
- /* Send the event */
- libvlc_event_send( p_mlist->p_event_manager, &event );
-}
-
-/**************************************************************************
- * media_descriptor_changed (private) (libvlc Event Callback )
- *
- * An item has changed.
- **************************************************************************/
-static void
-media_descriptor_changed( const libvlc_event_t * p_event, void * user_data )
-{
- libvlc_media_list_t * p_mlist = user_data;
- libvlc_media_descriptor_t * p_md = p_event->p_obj;
- libvlc_event_t event;
-
- /* Construct the new media list event */
- event.type = libvlc_MediaListItemChanged;
- event.u.media_list_item_changed.item = p_md;
-
- /* XXX: this is not good, but there is a solution in the pipeline */
- event.u.media_list_item_changed.index =
- libvlc_media_list_index_of_item( p_mlist, p_md, NULL );
-
- /* Send the event */
- libvlc_event_send( p_mlist->p_event_manager, &event );
-}
-
-/**************************************************************************
- * media_descriptor_subitem_added (private) (libvlc Event Callback )
- *
- * An item (which is a playlist) has gained sub child.
- **************************************************************************/
-static void
-media_descriptor_subitem_added( const libvlc_event_t * p_event, void * user_data )
-{
- libvlc_media_list_t * p_mlist = user_data;
- libvlc_media_descriptor_t * p_new_md;
-
- p_new_md = p_event->u.media_descriptor_subitem_added.new_child;
-
- /* For now, just add the new item to this media list */
- libvlc_media_list_add_media_descriptor( p_mlist, p_new_md, NULL );
-}
-
-/**************************************************************************
- * install_media_descriptor_observer (private)
- *
- * Do the appropriate action when an item is deleted.
- **************************************************************************/
-static void
-install_media_descriptor_observer( libvlc_media_list_t * p_mlist,
- libvlc_media_descriptor_t * p_md )
-{
- libvlc_event_attach( p_md->p_event_manager,
- libvlc_MediaDescriptorMetaChanged,
- media_descriptor_changed,
- p_mlist, NULL );
- libvlc_event_attach( p_md->p_event_manager,
- libvlc_MediaDescriptorSubItemAdded,
- media_descriptor_changed,
- p_mlist, NULL );
-}
-
-/**************************************************************************
- * uninstall_media_descriptor_observer (private)
- *
- * Do the appropriate action when an item is deleted.
- **************************************************************************/
-static void
-uninstall_media_descriptor_observer( libvlc_media_list_t * p_mlist,
- libvlc_media_descriptor_t * p_md )
-{
- libvlc_event_detach( p_md->p_event_manager,
- libvlc_MediaDescriptorMetaChanged,
- media_descriptor_changed,
- p_mlist, NULL );
- libvlc_event_detach( p_md->p_event_manager,
- libvlc_MediaDescriptorSubItemAdded,
- media_descriptor_changed,
- p_mlist, NULL );
-}
-
-/**************************************************************************
- * dynamic_list_propose_item (private) (Event Callback)
- *
- * This is called if the dynamic sublist's data provider adds a new item.
- **************************************************************************/
-static void
-dynamic_list_propose_item( const libvlc_event_t * p_event, void * p_user_data )
-{
- libvlc_media_list_t * p_submlist = p_user_data;
- libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_added.item;
-
- //libvlc_media_descriptor_lock( p_md );
- if( libvlc_tag_query_match( p_submlist->p_query, p_md, NULL ) )