예제 #1
0
 public Playlist(MtpDevice device, string name) : base(device, name)
 {
     this.playlist = new PlaylistStruct();
     TracksPtr     = IntPtr.Zero;
     Name          = name;
     Count         = 0;
 }
예제 #2
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;
 }
예제 #3
0
 public Playlist(MtpDevice device, string name)
     : base(device)
 {
     this.playlist = new PlaylistStruct ();
     Name = name;
     Count = 0;
 }
예제 #4
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;
 }
예제 #6
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);
        }
예제 #7
0
        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);
        }
예제 #8
0
 private static extern int LIBMTP_Create_New_Playlist(MtpDeviceHandle handle, ref PlaylistStruct metadata, uint parentHandle);
예제 #9
0
 internal Playlist(MtpDevice device, PlaylistStruct playlist) : base(device, playlist.tracks, playlist.no_tracks)
 {
     this.playlist = playlist;
 }
예제 #10
0
 private static extern int LIBMTP_Update_Playlist(MtpDeviceHandle handle, ref PlaylistStruct playlist);
예제 #11
0
 public Playlist(MtpDevice device, string name) : base(device)
 {
     this.playlist = new PlaylistStruct();
     Name          = name;
     Count         = 0;
 }
예제 #12
0
 private static extern int LIBMTP_Update_Playlist(MtpDeviceHandle handle, ref PlaylistStruct playlist);
예제 #13
0
 private static extern int LIBMTP_Create_New_Playlist(MtpDeviceHandle handle, ref PlaylistStruct metadata);
예제 #14
0
 internal Playlist (MtpDevice device, PlaylistStruct playlist) : base (device, playlist.tracks, playlist.no_tracks)
 {
     this.playlist = playlist;
 }