public List <mp3files> getList() { foreach (string musicFile in musicFiles) //musicFiles: array of the files in the folder { //mp3files: class that has the filename and tags of each song MP3Reader m = new MP3Reader(musicFile); //mp3s: list of type mp3sfiles of the songs in folder MP3Tag c = m.getTag(); mp3s.Add(new mp3files(musicFile, c)); } return(mp3s); }
public List <mp3files> getSpecificSort(string textbox, string type) { if (type == "Artist") { foreach (string musicFile in musicFiles) { MP3Reader m = new MP3Reader(musicFile); MP3Tag c = m.getTag(); if (c.Artist == textbox) { mp3s.Add(new mp3files(musicFile, c)); } } } else if (type == "Album") { foreach (string musicFile in musicFiles) { MP3Reader m = new MP3Reader(musicFile); MP3Tag c = m.getTag(); if (c.Album == textbox) { mp3s.Add(new mp3files(musicFile, c)); } } } else if (type == "Year") { foreach (string musicFile in musicFiles) { MP3Reader m = new MP3Reader(musicFile); MP3Tag c = m.getTag(); if (c.Year == textbox) { mp3s.Add(new mp3files(musicFile, c)); } } } else if (type == "Genre") { foreach (string musicFile in musicFiles) { MP3Reader m = new MP3Reader(musicFile); MP3Tag c = m.getTag(); if (c.Genere == textbox) { mp3s.Add(new mp3files(musicFile, c)); } } } else if (type == "Duration") { foreach (string musicFile in musicFiles) { MP3Reader m = new MP3Reader(musicFile); MP3Tag c = m.getTag(); if (c.Duration == textbox) { mp3s.Add(new mp3files(musicFile, c)); } } } return(mp3s); }