Example #1
0
 public static void PlayNextSong()
 {
     if (QueueSongNames.Count > 0)
     {
         PlaySongImmediately(QueueSongNames.Dequeue());
     }
 }
Example #2
0
        public static void QueueSong(string songName, QueueType queueType = QueueType.WaitForCurrent)
        {
            QueueSongNames.Enqueue(songName);

            if (queueType == QueueType.PlayImmediately)
            {
                PlayNextSong();
            }
        }
Example #3
0
 public static void Update()
 {
     if (MediaPlayer.State == MediaState.Stopped)
     {
         // If we have songs still queued then dequeue the next song name
         if (QueueSongNames.Count > 0)
         {
             CurrentSong = Songs[QueueSongNames.Dequeue()];
             MediaPlayer.Play(CurrentSong);
         }
         // Else just keep playing the song last played
         else if (CurrentSong != null)
         {
             MediaPlayer.Play(CurrentSong);
         }
     }
 }
Example #4
0
        public static void QueueSongs(List <string> songs, QueueType queueType = QueueType.WaitForCurrent)
        {
            // If we are not adding any songs, don't bother doing the rest of this function
            if (songs.Count == 0)
            {
                return;
            }

            foreach (string song in songs)
            {
                QueueSongNames.Enqueue(song);
            }

            if (queueType == QueueType.PlayImmediately)
            {
                PlayNextSong();
            }
        }
Example #5
0
 public static void ClearQueue()
 {
     CurrentSong = null;
     MediaPlayer.Stop();
     QueueSongNames.Clear();
 }