Example #1
0
        /// <summary>
        /// Skipping to next track.
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        public static TransitionInfo SkippedNext([NotNull] SpotifyState state)
        {
            var trans = new TransitionInfo(Reason.fwdbtn, Reason.fwdbtn);

            if (state.GetCurrentPlayable() != null)
            {
                trans.EndedWhen = state.GetPosition();
            }
            return(trans);
        }
Example #2
0
        /// <summary>
        /// Skipping to another track in the same context.
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        public static TransitionInfo SkipTo([NotNull] SpotifyState state)
        {
            var trans = new TransitionInfo(
                Reason.endplay,
                Reason.clickrow);

            if (state.GetCurrentPlayable() != null)
            {
                trans.EndedWhen = state.GetPosition();
            }
            return(trans);
        }
Example #3
0
        /// <summary>
        /// Context changed.
        /// </summary>
        /// <param name="state"></param>
        /// <param name="withSkip"></param>
        /// <returns></returns>
        public static TransitionInfo ContextChange(
            [NotNull] SpotifyState state, bool withSkip)
        {
            var trans = new TransitionInfo(Reason.endplay,
                                           withSkip
                    ? Reason.clickrow
                    : Reason.playbtn);

            if (state.GetCurrentPlayable() != null)
            {
                trans.EndedWhen = state.GetPosition();
            }
            return(trans);
        }