Exemplo n.º 1
0
 private void MediaManager_OnPlaybackStateChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionPlaybackInfo args)
 {
     Invoke(new MethodInvoker(
                () => {
         textBox1.Text = args.PlaybackStatus.ToString("g");
     }
                ));
 }
Exemplo n.º 2
0
        private static void MediaManager_OnPlaybackStateChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionPlaybackInfo args)
        {
            WriteLineColor($"{sender.ControlSession.SourceAppUserModelId} is now {args.PlaybackStatus}", ConsoleColor.Magenta);
            int status = (int)args.PlaybackStatus;

            WrieObject(new PlaybackInfo()
            {
                Status = (PlaybackStatus)status, IsStatusOnly = true
            });
        }
Exemplo n.º 3
0
 private void MediaManager_OnSongChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionMediaProperties args)
 {
     textBox2.Text = args.Title;
     textBox3.Text = args.Artist;
     if (args.Thumbnail != null)
     {
         //Task<Image> ti = GetImage(args.Thumbnail);
         //ti.Wait();
         label5.Image = GetImage(args.Thumbnail);
     }
 }
Exemplo n.º 4
0
 private void MediaManager_OnRemovedSource(MediaManager.MediaSession session)
 {
     //throw new NotImplementedException();
 }
Exemplo n.º 5
0
 private void MediaManager_OnNewSource(MediaManager.MediaSession session)
 {
 }
Exemplo n.º 6
0
 private static void MediaManager_OnSongChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionMediaProperties args)
 {
     WriteLineColor($"{sender.ControlSession.SourceAppUserModelId} is now playing {args.Title} {(string.IsNullOrEmpty(args.Artist) ? "" : $"by {args.Artist}")}", ConsoleColor.Cyan);
Exemplo n.º 7
0
 private static void MediaManager_OnRemovedSource(MediaManager.MediaSession session)
 {
     WriteLineColor("-- Removed Source: " + session.ControlSession.SourceAppUserModelId, ConsoleColor.Red);
 }
Exemplo n.º 8
0
 private static void MediaManager_OnNewSource(MediaManager.MediaSession session)
 {
     WriteLineColor("-- New Source: " + session.ControlSession.SourceAppUserModelId, ConsoleColor.Green);
 }
Exemplo n.º 9
0
 private static void MediaManager_OnAnyPlaybackStateChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionPlaybackInfo args)
 {
     WriteLineColor($"{sender.Id} is now {args.PlaybackStatus}", ConsoleColor.Yellow);
 }
Exemplo n.º 10
0
 private static void MediaManager_OnAnySessionClosed(MediaManager.MediaSession session)
 {
     WriteLineColor("-- Removed Source: " + session.Id, ConsoleColor.Red);
 }
Exemplo n.º 11
0
 private static void MediaManager_OnAnySessionOpened(MediaManager.MediaSession session)
 {
     WriteLineColor("-- New Source: " + session.Id, ConsoleColor.Green);
 }