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(""); } } } }
private Album changeAlbum(string Name, Artist art) { Album alb; if (art.getAlbums().searchName(Name)) { alb = Artists.searchArtist(art.getName()).getAlbums().searchAlbum(Name); } else { alb = new Album(Name, art, Properties.Resources.album); art.getAlbums().add(alb); } return(alb); }
public void drawOnAlbumList() { int imageindex = 0; AlbumForArtist.Images.Clear(); 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); AlbumForArtist.Images.Add(alb.GetBitImage()); ListViewItem album = new ListViewItem(alb.getName(), imageindex); imageindex++; //album.SubItems.Add(alb.getArtist().getName()); //album.SubItems.Add(alb.getYear().ToString()); listView2.Items.Add(album); } } }
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); } } }