Exemplo n.º 1
0
        private void Skip(bool canSkip, SkipDirection direction)
        {
            if (!canSkip || InvalidState)
            {
                return;
            }
            var skip = new Skip(Zone.SelectedInput, direction);

            skip.Send(TheController, RefreshOnSuccess);
        }
Exemplo n.º 2
0
        private static string GetDirectionString(SkipDirection direction)
        {
            switch (direction)
            {
            case SkipDirection.Forward:
                return(@"Skip Fwd");

            case SkipDirection.Backward:
                return(@"Skip Rev");

            default:
                return(string.Empty);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Skips a Track in the given direction.
        /// </summary>
        /// <param name="direction">
        /// The direction to skip.
        /// </param>
        public static void SkipTrack(SkipDirection direction)
        {
            PlayedSongs.Add(CurrentIndex);

            if (Shuffle)
            {
                var rnd = new Random();
                switch (direction)
                {
                case SkipDirection.Forward:
                    do
                    {
                        CurrentIndex = rnd.Next(CurrentPlaylist.Count - 1);
                    }while (PlayedSongs.Contains(CurrentIndex));
                    break;

                case SkipDirection.Backward:
                    if (PlayedSongs.Count > 1)
                    {
                        CurrentIndex = PlayedSongs[PlayedSongs.Count - 1];
                    }

                    break;
                }
            }
            else if (Repeat)
            {
            }
            else
            {
                switch (direction)
                {
                case SkipDirection.Backward:
                    if (CurrentIndex - 1 > -1)
                    {
                        CurrentIndex--;
                    }
                    break;

                case SkipDirection.Forward:
                    if (CurrentIndex + 1 < CurrentPlaylist.Count)
                    {
                        CurrentIndex++;
                    }
                    break;
                }
            }

            Playback.Next();
        }
Exemplo n.º 4
0
 public Skip(Input i, SkipDirection direction)
 {
     Direction = direction;
     Input     = i;
 }