static public musicinfo[] fi2mi(FileInfo[] fi) { musicinfo[] mi = new musicinfo[fi.Length]; for (int i = 0; i < fi.Length; i++) { mi[i] = new musicinfo(fi[i]); } return(mi); }
public bool check_if_existed(musicinfo mi) { foreach (var i in musicfiles) { if (i.musicfileinfo.FullName.Equals(mi.musicfileinfo.FullName)) { return(true); } } return(false); }
public void add_music(FileInfo fi) { var mi = new musicinfo(fi); if (!mlc.collection[mlc.now_list_index].check_if_existed(mi)) { mlc.collection[mlc.now_list_index].addmusic(mi); var index = mlc.collection[mlc.now_list_index].musicfiles.Count - 1; var album = mlc.collection[mlc.now_list_index].albums[index]; var title = mlc.collection[mlc.now_list_index].titles[index]; var artist = mlc.collection[mlc.now_list_index].artists[index]; listView2.Items.Add(new ListViewItem("【" + album + "】" + title + "【" + artist + "】")); } }
public void addmusic(musicinfo mi) { musicfiles.Add(mi); var tab = TagLib.File.Create(mi.musicfileinfo.FullName); titles.Add(tab.Tag.Title); if (tab.Tag.Performers.Length > 0) { artists.Add(tab.Tag.Performers[0]); } else { artists.Add("unknow"); } tracks.Add(tab.Tag.Track.ToString()); albums.Add(tab.Tag.Album); }