Ejemplo n.º 1
0
        public static void PlayNext(Song current)
        {
            var sl = CurrentSongList;

            if (Current == null || sl == null) return;

            switch (NextState)
            {
                case State.Next:
                    int index = sl.IndexOf(current);

                    if (sl.Count-1 == index)
                        index = -1;

                    Play(sl[index + 1]);
                    break;

                case State.Shuffle:
                    var rand = new Random();
                    Play(sl[rand.Next(sl.Count)]);
                    break;

                case State.Repeat:
                    Play(current);
                    break;
            }
        }
Ejemplo n.º 2
0
 public static bool Play(Song song)
 {
     try
     {
         Stop();
         Current = Engine.Play2D(song.Path);
         CurrentSong = song;
         IsPlaying = true;
         song.IsPlaying = true;
         song.Style = Text.Styles.Bold;
     }
     catch
     {
         return false;
     }
     return true;
 }