示例#1
0
        /// <summary>
        /// Start playing the current track (if not already playing).
        /// </summary>
        /// <returns>Whether the operation was successful.</returns>
        public bool Play(bool restart = false)
        {
            IsUserPaused = false;

            if (restart)
            {
                CurrentTrack.Restart();
            }
            else if (!IsPlaying)
            {
                CurrentTrack.Start();
            }

            return(true);
        }
示例#2
0
        /// <summary>
        /// Start playing the current track (if not already playing).
        /// </summary>
        /// <param name="restart">Whether to restart the track from the beginning.</param>
        /// <param name="requestedByUser">
        /// Whether the request to play was issued by the user rather than internally.
        /// Specifying <c>true</c> will ensure that other methods like <see cref="EnsurePlayingSomething"/>
        /// will resume music playback going forward.
        /// </param>
        /// <returns>Whether the operation was successful.</returns>
        public bool Play(bool restart = false, bool requestedByUser = false)
        {
            if (requestedByUser)
            {
                UserPauseRequested = false;
            }

            if (restart)
            {
                CurrentTrack.Restart();
            }
            else if (!IsPlaying)
            {
                CurrentTrack.Start();
            }

            return(true);
        }