//Returns the next song request to be sung from the singer queue and updates the queue public SongToPlay GetNextSongRequest() { if (this.SongRequestQueue.Count == 0) return null; else { queueSinger nextSinger = this.SongRequestQueue[0]; int nextID = nextSinger.user.userID; //If this next singer doesn't have a song request keep popping until we find a valid request or we come back around int currentID = -1; while (nextSinger.songs.Length == 0 && currentID != nextID) { PopSongQueue(); nextSinger = this.SongRequestQueue[0]; currentID = nextSinger.user.userID; } //No song requests were found in the entire queue so there is nothing to return if (nextSinger.songs.Length == 0) return null; SongToPlay songToPlay = new SongToPlay(nextSinger.songs[0], nextSinger.user); PopSongQueue(); return songToPlay; } }
private void UpdateNowPlaying(SongToPlay songToPlay) { labelCurrentSinger.Text = "Now Singing: " + songToPlay.User.userName; labelCurrentSong.Text = "Now Playing: " + songToPlay.Song.artist + " - " + songToPlay.Song.title; player.Open(songToPlay.Song.pathOnDisk); player.Stop(); }