Changeset 143
- Timestamp:
- 03/07/07 14:45:48 (2 years ago)
- Files:
-
- dmp/trunk/vlc.NET/NativeLibVlc.cs (modified) (3 diffs)
- dmp/trunk/vlc.NET/VlcUserControl.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dmp/trunk/vlc.NET/NativeLibVlc.cs
r133 r143 427 427 int OptionsCount); 428 428 [DllImport("libvlc")] 429 static extern VlcError playlist_DeleteFromInput(IntPtr p_playlist, Int32 id, int locked);429 static extern int libvlc_playlist_delete_item(ref libvlc_instance_t libvlc, Int32 id, ref libvlc_exception_t p_exception); 430 430 431 431 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] … … 1375 1375 try 1376 1376 { 1377 using (VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))1378 {1379 if (v obj.SubObject != IntPtr.Zero)1377 using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle)) 1378 { 1379 if (vpobj.SubObject != IntPtr.Zero) 1380 1380 { 1381 VlcError enmErr = playlist_DeleteFromInput(vobj.SubObject, itemId, 1); 1382 return enmErr; 1383 } 1384 else 1385 { 1386 return VlcError.NoObj; 1381 libvlc_playlist_delete_item(ref vpobj.libvlc, itemId, ref vpobj.exception); 1382 if (!vpobj.exception.WasExceptionRaised()) 1383 { 1384 return VlcError.Success; 1385 } 1387 1386 } 1388 1387 } 1388 return VlcError.Generic; 1389 1389 } 1390 1390 catch (Exception ex) … … 1409 1409 { 1410 1410 if(vobj.SubObject != IntPtr.Zero) 1411 {1411 { 1412 1412 VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append, 1413 1413 EndOfPlaylist, -1L, options, optionsCount); dmp/trunk/vlc.NET/VlcUserControl.cs
r133 r143 1020 1020 public void RemoveFromPlaylist(int itemId) 1021 1021 { 1022 Debug.WriteLine("Trying to remove item from playlist "); 1023 this.nativeVlc.RemoveTarget(itemId); 1024 Debug.WriteLine("Removed item from playlist "); 1022 Debug.WriteLine("Trying to remove item with id " + itemId.ToString() + " from playlist "); 1023 if (this.nativeVlc.RemoveTarget(itemId) == VlcError.Success) 1024 { 1025 Debug.WriteLine("Removed item from playlist."); 1026 } 1027 else 1028 { 1029 Debug.WriteLine("Could not remove item from playlist."); 1030 } 1025 1031 } 1026 1032
