private void MediaManager_OnPlaybackStateChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionPlaybackInfo args) { Invoke(new MethodInvoker( () => { textBox1.Text = args.PlaybackStatus.ToString("g"); } )); }
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 }); }
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); } }
private void MediaManager_OnRemovedSource(MediaManager.MediaSession session) { //throw new NotImplementedException(); }
private void MediaManager_OnNewSource(MediaManager.MediaSession session) { }
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);
private static void MediaManager_OnRemovedSource(MediaManager.MediaSession session) { WriteLineColor("-- Removed Source: " + session.ControlSession.SourceAppUserModelId, ConsoleColor.Red); }
private static void MediaManager_OnNewSource(MediaManager.MediaSession session) { WriteLineColor("-- New Source: " + session.ControlSession.SourceAppUserModelId, ConsoleColor.Green); }
private static void MediaManager_OnAnyPlaybackStateChanged(MediaManager.MediaSession sender, GlobalSystemMediaTransportControlsSessionPlaybackInfo args) { WriteLineColor($"{sender.Id} is now {args.PlaybackStatus}", ConsoleColor.Yellow); }
private static void MediaManager_OnAnySessionClosed(MediaManager.MediaSession session) { WriteLineColor("-- Removed Source: " + session.Id, ConsoleColor.Red); }
private static void MediaManager_OnAnySessionOpened(MediaManager.MediaSession session) { WriteLineColor("-- New Source: " + session.Id, ConsoleColor.Green); }