예제 #1
0
 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);
 }
예제 #2
0
 public bool check_if_existed(musicinfo mi)
 {
     foreach (var i in musicfiles)
     {
         if (i.musicfileinfo.FullName.Equals(mi.musicfileinfo.FullName))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
        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 + "】"));
            }
        }
예제 #4
0
        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);
        }