Merge refs/heads/developer into refs/heads/gui

This commit is contained in:
Janco Kock
2015-10-29 23:01:35 +01:00
3 changed files with 64 additions and 1 deletions
+36 -1
View File
@@ -24,7 +24,42 @@ namespace MusicPlayer
return o["songurl"].ToString();
}
return o["errormsg"].ToString();
}
}
public List<Song> GetSongsByAlbum(string albumname)
{
return GetSongsByArgs("album=" + albumname);
}
public List<Song> GetSongsByArtist(string artistname)
{
return GetSongsByArgs("artist=" + artistname);
}
public List<Song> GetSongsByGenre(string genre)
{
return GetSongsByArgs("genre=" + genre);
}
public List<Song> GetSongsByYear(string year)
{
return GetSongsByArgs("album=" + year);
}
public List<Song> GetSongsByArgs(string args)
{
List<Song> songslist = new List<Song>();
JObject o = nw.SendString("getsongs?"+args);
if (o["result"].ToString() == "OK")
{
dynamic songs = o["songs"];
for (int i = 0; i < songs.Count; i++)
{
songslist.Add(new Song(songs[i][0].ToString(), songs[i][3].ToString(), songs[i][5].ToString(), songs[i][4].ToString(), this));
}
}
return songslist;
}
public List<Artist> GetArtists()
{
+16
View File
@@ -19,6 +19,22 @@ namespace MusicPlayer
NetworkHandler nw = new NetworkHandler("http://www.imegumii.nl");
APIHandler api = new APIHandler(nw);
// api.GetSongsByArtist("Amon Amarth").ForEach(s =>
// {
// Console.WriteLine(s.SongID);
// });
// api.GetSongsByYear("2009").ForEach(s =>
// {
// Console.WriteLine(s.Name);
// });
api.GetSongsByGenre("Melodic Death Metal").ForEach(s =>
{
Console.WriteLine(s.Name);
});
// api.GetSongsByAlbum("Stronger").ForEach(s =>
// {
// Console.WriteLine(s.Name);
// });
MainForm form = new MainForm();
new Main(nw, api, form);
+12
View File
@@ -0,0 +1,12 @@
# musicplayer
##Onderdelen
- Server/Client
- Threading/Threadpools
- File IO
- Socket communicatie
- Klasse Structuur
- Forms Applicatie
- Specifieke C# - Delegates/Lambda...