public Playlist(MtpDevice device, string name) : base(device, name) { this.playlist = new PlaylistStruct(); TracksPtr = IntPtr.Zero; Name = name; Count = 0; }
internal Playlist(MtpDevice device, PlaylistStruct playlist) : base(device, playlist.tracks, playlist.no_tracks) { // Once we've loaded the tracks, set the TracksPtr to NULL as it // will be freed when the Playlist constructor is finished. this.playlist = playlist; TracksPtr = IntPtr.Zero; }
public Playlist(MtpDevice device, string name) : base(device) { this.playlist = new PlaylistStruct (); Name = name; Count = 0; }
internal Playlist (MtpDevice device, PlaylistStruct playlist) : base (device, playlist.tracks, playlist.no_tracks) { // Once we've loaded the tracks, set the TracksPtr to NULL as it // will be freed when the Playlist constructor is finished. this.playlist = playlist; TracksPtr = IntPtr.Zero; }
public Playlist (MtpDevice device, string name) : base (device, name) { this.playlist = new PlaylistStruct (); TracksPtr = IntPtr.Zero; Name = name; Count = 0; }
public List <Playlist> GetPlaylists() { List <Playlist> playlists = new List <Playlist> (); IntPtr ptr = Playlist.LIBMTP_Get_Playlist_List(Handle); while (ptr != IntPtr.Zero) { PlaylistStruct d = (PlaylistStruct)Marshal.PtrToStructure(ptr, typeof(PlaylistStruct)); playlists.Add(new Playlist(this, d)); ptr = d.next; } return(playlists); }
internal static List <Playlist> GetPlaylists(MtpDevice device) { List <Playlist> playlists = new List <Playlist> (); IntPtr ptr = Playlist.LIBMTP_Get_Playlist_List(device.Handle); while (ptr != IntPtr.Zero) { // Destroy the struct *after* we use it to ensure we don't access freed memory // for the 'tracks' variable PlaylistStruct d = (PlaylistStruct)Marshal.PtrToStructure(ptr, typeof(PlaylistStruct)); playlists.Add(new Playlist(device, d)); LIBMTP_destroy_playlist_t(ptr); ptr = d.next; } return(playlists); }
private static extern int LIBMTP_Create_New_Playlist(MtpDeviceHandle handle, ref PlaylistStruct metadata, uint parentHandle);
internal Playlist(MtpDevice device, PlaylistStruct playlist) : base(device, playlist.tracks, playlist.no_tracks) { this.playlist = playlist; }
private static extern int LIBMTP_Update_Playlist(MtpDeviceHandle handle, ref PlaylistStruct playlist);
public Playlist(MtpDevice device, string name) : base(device) { this.playlist = new PlaylistStruct(); Name = name; Count = 0; }
private static extern int LIBMTP_Create_New_Playlist(MtpDeviceHandle handle, ref PlaylistStruct metadata);
internal Playlist (MtpDevice device, PlaylistStruct playlist) : base (device, playlist.tracks, playlist.no_tracks) { this.playlist = playlist; }