public Album(IntPtr albumPtr) { if (albumPtr == IntPtr.Zero) { throw new InvalidOperationException("Album pointer is null."); } this.AlbumPtr = albumPtr; this.Name = Utils.PtrToString(libspotify.sp_album_name(albumPtr)); this.Type = libspotify.sp_album_type(albumPtr); IntPtr artistPtr = libspotify.sp_album_artist(albumPtr); if (artistPtr != IntPtr.Zero) { this.Artist = Utils.PtrToString(libspotify.sp_artist_name(artistPtr)); } }
public Album(IntPtr albumPtr) { if (albumPtr == IntPtr.Zero) { throw new ArgumentNullException("Album pointer is null."); } this.AlbumPtr = albumPtr; this.Name = Functions.PtrToString(libspotify.sp_album_name(albumPtr)); this.Type = libspotify.sp_album_type(albumPtr); IntPtr artistPtr = libspotify.sp_album_artist(albumPtr); if (artistPtr != IntPtr.Zero) { this.Artist = Functions.PtrToString(libspotify.sp_artist_name(artistPtr)); } }