Changeset 133

Show
Ignore:
Timestamp:
03/05/07 22:11:42 (2 years ago)
Author:
tulloss2
Message:

Added delete from playlist function from native dll (not tested)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmp/trunk/vlc.NET/NativeLibVlc.cs

    r50 r133  
    426426                        [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]string[] Options, 
    427427                        int OptionsCount); 
     428        [DllImport("libvlc")] 
     429        static extern VlcError playlist_DeleteFromInput(IntPtr p_playlist, Int32 id, int locked); 
    428430 
    429431                [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 
     
    13681370                        } 
    13691371                } 
     1372 
     1373        public VlcError RemoveTarget(int itemId) 
     1374        { 
     1375            try 
     1376            { 
     1377                using (VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST)) 
     1378                { 
     1379                    if (vobj.SubObject != IntPtr.Zero) 
     1380                    { 
     1381                        VlcError enmErr = playlist_DeleteFromInput(vobj.SubObject, itemId, 1); 
     1382                        return enmErr; 
     1383                    } 
     1384                    else 
     1385                    { 
     1386                        return VlcError.NoObj; 
     1387                    } 
     1388                } 
     1389            } 
     1390            catch (Exception ex) 
     1391            { 
     1392                this.lastErrorMessage = ex.Message; 
     1393                return VlcError.Exception; 
     1394            } 
     1395        } 
     1396 
    13701397 
    13711398                public VlcError AddTarget(string target, string[] options, ref int itemId) 
  • dmp/trunk/vlc.NET/VlcUserControl.cs

    r117 r133  
    10181018                } 
    10191019 
     1020        public void RemoveFromPlaylist(int itemId) 
     1021        { 
     1022            Debug.WriteLine("Trying to remove item from playlist "); 
     1023            this.nativeVlc.RemoveTarget(itemId); 
     1024            Debug.WriteLine("Removed item from playlist "); 
     1025        } 
     1026 
    10201027                public void PlayItem(int itemId) 
    10211028                {