Exemple #1
0
 public Track(Album al, Artist ar, int num, string title, string filename)
 {
     m_album = al;
     m_artist = ar;
     m_trackNum = num;
     m_title = title;
     m_fileName = filename;
 }
 private void AddFile(string file)
 {
     m_curFile++;
     if (file.Length > 255)
     {
         return;
     }
     TagLib.File trackinfo = TagLib.File.Create(file);
     Album album = GetAlbum(trackinfo.Tag.Album);
     if (album == null)
     {
         album = new Album(trackinfo.Tag.Album);
         m_albums.Add(album);
     }
     Artist artist = GetArtist(trackinfo.Tag.FirstArtist);
     if (artist == null)
     {
         artist = new Artist(trackinfo.Tag.FirstArtist);
         m_artists.Add(artist);
     }
     // yes, this one is slightly easier to follow, but, the way info's going around is still confusing.
     Track track = new Track(album, artist, (int)trackinfo.Tag.Track, trackinfo.Tag.Title, file);
     m_tracks.Add(track);
     album.Add(track);
     artist.Tracks.Add(track);
     artist.Albums.Add(album);
     if (Progress != null)
     {
         Progress(m_curFile, m_fileCount);
     }
 }