Exemplo n.º 1
0
        public void drawOnSongList()
        {
            lstSongs.Items.Clear();
            lstSongs.View = View.Details;
            for (int i = 0; i < Artists.getLength(); i++)
            {
                Artist art = Artists.getValue(i);
                for (int j = 0; j < art.getAlbums().getLength(); j++)
                {
                    Album alb = art.getAlbums().getValue(j);
                    for (int k = 0; k < alb.getSongs().getLength(); k++)
                    {
                        Song file = alb.getSongs().getValue(k);

                        TagLib.File  data = TagLib.File.Create(file.getURL());
                        ListViewItem song = new ListViewItem(file.getName());
                        Console.WriteLine(file.getName());
                        lstSongs.Items.Add(song);
                        song.SubItems.Add(setTime(data.Properties.Duration.ToString()));
                        song.SubItems.Add(file.getArtist().getName());
                        song.SubItems.Add(file.getAlbum().getName());
                        song.SubItems.Add(file.getYear().ToString());
                        song.SubItems.Add("");
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void drawOnAlbumSongList(ListViewItem lista)
        {
            listView2Mode = "song";
            listView2.Items.Clear();
            listView2.View = View.Details;
            Album alb = Albums.searchAlbum(lista.Text);

            for (int i = 0; i < alb.getSongs().getLength(); i++)
            {
                Song         file = alb.getSongs().getValue(i);
                TagLib.File  data = TagLib.File.Create(file.getURL());
                ListViewItem song = new ListViewItem((i + 1).ToString());
                song.SubItems.Add(file.getName());
                song.SubItems.Add(setTime(data.Properties.Duration.ToString()));
                song.SubItems.Add(file.getArtist().getName());
                song.SubItems.Add(file.getAlbum().getName());
                listView2.Items.Add(song);
            }
        }
Exemplo n.º 3
0
        private void toolStrip3_ItemClicked_1(object sender, ToolStripItemClickedEventArgs e)
        {
            //SongOrAlbumLV1 = false;
            listView1.FullRowSelect = true;
            listView1.Groups.Clear();
            listView1.Items.Clear();
            AlbumForArtist.Images.Clear();
            listView1.Visible = true;
            ToolStripItem var = e.ClickedItem;

            Console.WriteLine(var.Name);
            Artist art = Artists.searchArtist(var.Name);

            for (int i = 0; i < art.getAlbums().getLength(); i++)
            {
                Album alb = art.getAlbums().getValue(i);
                AlbumForArtist.Images.Add(alb.GetBitImage());
                ListViewGroup albumArt = new ListViewGroup(alb.getName(), HorizontalAlignment.Left);
                albumArt.Name = alb.getName();
                listView1.Groups.Add(albumArt);
                Console.WriteLine("album" + listView1.Groups[i].Name);
                //listView1.Items.Add(new ListViewItem("", i,albumArt)); #Tried to display image



                for (int j = 0; j < alb.getSongs().getLength(); j++)
                {
                    Song         song    = alb.getSongs().getValue(j);
                    ListViewItem songArt = new ListViewItem(song.getName(), albumArt);
                    songArt.Name = song.getName();

                    albumArt.Items[j].Text = song.getAlbumIndex().ToString();
                    songArt.SubItems.Add(song.getName());
                    songArt.SubItems.Add(setTime(TagLib.File.Create(song.getURL()).Properties.Duration.ToString()));
                    songArt.SubItems.Add(song.getArtist().getName());
                    Console.WriteLine("song" + albumArt.Items[j].Name);
                    listView1.Items.Add(songArt);
                }
            }
        }