示例#1
0
 /**
  * Clear the list.
  */
 public void Clear()
 {
     Logger.Debug("Clear()");
     try {
         LockList();
         // Traverse the list from the end back to the start...
         for (int i = LibVlc.libvlc_media_list_count(mediaListInstance) - 1; i >= 0; i--)
         {
             LibVlc.libvlc_media_list_remove_index(mediaListInstance, i);
         }
     }
     finally {
         UnlockList();
     }
 }
示例#2
0
 /**
  * Remove a media item from the play-list.
  *
  * @param index item to remove (counting from zero)
  */
 public void RemoveMedia(int index)
 {
     Logger.Debug("RemoveMedia(index={})", index);
     try {
         LockList();
         IntPtr oldMediaInstance = LibVlc.libvlc_media_list_item_at_index(mediaListInstance, index);
         if (oldMediaInstance != IntPtr.Zero)
         {
             // Remove the media descriptor from the media list
             LibVlc.libvlc_media_list_remove_index(mediaListInstance, index);
             // Release the native media instance
             LibVlc.libvlc_media_release(oldMediaInstance);
         }
     }
     finally {
         UnlockList();
     }
 }