private void PlayButtonClick(object sender, RoutedEventArgs e)
        {
            controller.Pause();
            TimeSpan oldtime = controller.Position;

            controller.Duration = null;
            controller.Resume();
            controller.Position = oldtime;
            LrcUpdateTimer.Start();

            UpdateLrcEditBarAutoScroll(true);
        }
Beispiel #2
0
 private void LoadLrc(Lrc lrcdata)
 {
     LrcData = lrcdata;
     lrcdatapanel.Children.Clear();
     LrcTimeLines.Clear();
     foreach (var item in lrcdata.LrcWord)
     {
         var textblock = new TextBlock();
         textblock.Style = (Style)Resources["unlrcview"];
         textblock.Text  = item.Value;
         LrcTimeLines.Add(TimeSpan.FromMilliseconds(item.Key));
         lrcdatapanel.Children.Add(textblock);
     }
     if (Class.MediaControl.GetCurrent().CurrentState == Windows.Media.Playback.MediaPlayerState.Playing)
     {
         LrcUpdateTimer.Start();
     }
 }
Beispiel #3
0
        private void LrcViewPanel_CurrentStateChanged(MediaPlayer sender, object args)
        {
            mainFrame.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                switch (sender.CurrentState)
                {
                case MediaPlayerState.Playing:
                    LoadLrcFromLocal();
                    LrcUpdateTimer.Start();
                    break;

                case MediaPlayerState.Paused:
                    LoadLrcFromLocal();
                    LrcUpdateTimer.Stop();
                    break;

                default:
                    break;
                }
            });
        }