コード例 #1
0
 public async static Task<MusicLibraryViewModel.TrackItem> GetTrackItemFromFile(StorageFile track)
 {
     var trackInfos = await track.Properties.GetMusicPropertiesAsync();
     var trackItem = new MusicLibraryViewModel.TrackItem
     {
         ArtistName = string.IsNullOrEmpty(trackInfos.Artist) ? "Unknown artist" : trackInfos.Artist,
         AlbumName = trackInfos.Album,
         Name = trackInfos.Title,
         Path = track.Path,
         Duration = trackInfos.Duration,
         Index = 0
     };
     return trackItem;
 }
コード例 #2
0
 public async static Task<MusicLibraryViewModel.TrackItem> GetTrackItemFromFile(StorageFile track, string artist, string name, int i, int artistId, int albumId)
 {
     var trackInfos = await track.Properties.GetMusicPropertiesAsync();
     var trackItem = new MusicLibraryViewModel.TrackItem
     {
         ArtistName = string.IsNullOrEmpty(artist) ? "Unknown artist" : artist,
         AlbumName = name,
         Name = trackInfos.Title,
         Path = track.Path,
         Duration = trackInfos.Duration,
         Index = i,
         ArtistId = artistId,
         AlbumId = albumId
     };
     return trackItem;
 }