Beispiel #1
0
        /// <summary>
        /// 播放电台时使用修改底部播放条
        /// </summary>
        /// <param name="bitmapImage"></param>
        /// <param name="musicName"></param>
        /// <param name="artistName"></param>
        /// <param name="albumName"></param>
        /// <param name="maximum"></param>
        /// <param name="isStartPlaying"></param>
        async void ChangePlayBar(BitmapImage bitmapImage, string musicName, string artistName, string albumName, int maximum, bool isStartPlaying = true)
        {
            Image_playingAlbum.Source = bitmapImage;//修改专辑图片
            TextBlcok_musicName.Text  = musicName;
            TextBlcok_artistName.Text = artistName;
            TextBlcok_albumName.Text  = albumName;
            TextBlock_lengthTime.Text = await Task.Run(() => OtherHelper.GetDt(maximum));

            if (isStartPlaying)
            {
                SymbolIcon_stopOrPlay.Symbol = Symbol.Pause;
            }
        }
Beispiel #2
0
        //监控修改播放进度条
        private async void _mediaTimelineController_PositionChanged(MediaTimelineController sender, object args)
        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                isSliderChangedFromAuto = true;
                Slider_play.Value       = sender.Position.TotalSeconds;

                TextBlock_currentTime.Text = OtherHelper.GetDt((int)sender.Position.TotalSeconds);
                if ((Application.Current as App).playingPage != null)
                {
                    (Application.Current as App).playingPage.ChangeLyricPosition(sender.Position.TotalMilliseconds);
                }
            });
        }
Beispiel #3
0
        async void ChangePlayBar(SongsItem song, BitmapImage bitmapImage, string musicName, string artistName, string albumName, int maximum, bool isStartPlaying = true)
        {
            Image_playingAlbum.Source = bitmapImage;//修改专辑图片
            TextBlcok_musicName.Text  = musicName;
            TextBlcok_artistName.Text = artistName;
            TextBlcok_albumName.Text  = albumName;
            TextBlock_lengthTime.Text = await Task.Run(() => OtherHelper.GetDt(maximum));

            if (isStartPlaying)
            {
                SymbolIcon_stopOrPlay.Symbol = Symbol.Pause;
            }
            if (song.isFavorite)
            {
                TextBlock_isOrnotFavorite.Text = "\xE00B";
            }
            else
            {
                TextBlock_isOrnotFavorite.Text = "\xE006";
            }
        }