Example #1
0
    /// <summary>
    /// 向前播放
    /// </summary>
    public void PlayForward()
    {
        PlayingType = PLAYTYPE.FORWARD;

        PlayingTime = isPlaying ? 1f - PlayingTime : 0f;

        Play();
    }
Example #2
0
    /// <summary>
    /// 向前播放
    /// </summary>
    public void PlayForward()
    {
        PlayingType = PLAYTYPE.FORWARD;

        PlayingTime = isPlaying ? AnimCurve[AnimCurve.length - 1].time - PlayingTime : 0f;

        Play();
    }
Example #3
0
    /// <summary>
    ///  向后播放
    /// </summary>
    public void PlayBack()
    {
        PlayingType = PLAYTYPE.BACK;

        PlayingTime = isPlaying ? 1f - PlayingTime : 0f;

        Play();
    }
Example #4
0
    /// <summary>
    ///  向后播放
    /// </summary>
    public void PlayBack()
    {
        PlayingType = PLAYTYPE.BACK;

        PlayingTime = isPlaying ? AnimCurve[AnimCurve.length - 1].time - PlayingTime : 0f;

        Play();
    }
        /// <summary>
        /// 在此页将要在 Frame 中显示时进行调用。
        /// </summary>
        /// <param name="e">描述如何访问此页的事件数据。
        /// 此参数通常用于配置页。</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            AudioPlayInfo para = e.Parameter as AudioPlayInfo;

            if (para == null)
            {
                bool isPlayButton = false;
                //保持原有播放状态
                if (IsMyBackgroundTaskRunning)
                {
                    ChangePlayTimeNum();

                    ChangePlayTimeCurrent();

                    double value = 0;
                    if (_dPlaySum != 0)
                    {
                        value = _dTimeNUm / _dPlaySum * 100;
                    }
                    PlayProgress.Value = value;

                    if (MediaPlayerState.Playing == BackgroundMediaPlayer.Current.CurrentState)
                    {
                        isPlayButton = true;
                        _timer.Start();
                    }
                }

                SetPlayButtonState(isPlayButton);
            }
            else
            {
                _fileToken = para.fileToken;
                _playType  = para.PlayType;
                _filePath  = para.Path;
                _stSong    = para.Song;
                Play();
            }

            textBlockSong.Text = _stSong;
        }