From ce99864aad43cab3bce6f9fda9e590df8a9101d7 Mon Sep 17 00:00:00 2001 From: Tim Schneeberger Date: Tue, 10 May 2022 01:10:01 +0200 Subject: [PATCH] Fix Mpris --- .../Platform/Linux/MediaKeyRemote.Linux.cs | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/GalaxyBudsClient/Platform/Linux/MediaKeyRemote.Linux.cs b/GalaxyBudsClient/Platform/Linux/MediaKeyRemote.Linux.cs index 9d218433f..c0976827e 100644 --- a/GalaxyBudsClient/Platform/Linux/MediaKeyRemote.Linux.cs +++ b/GalaxyBudsClient/Platform/Linux/MediaKeyRemote.Linux.cs @@ -1,20 +1,23 @@ -using System; +#if Linux + +using System; using GalaxyBudsClient.Platform.Interfaces; using Serilog; using Tmds.DBus; +using ThePBone.MprisClient; namespace GalaxyBudsClient.Platform.Linux { public class MediaKeyRemote : IMediaKeyRemote { -#if Linux - private readonly ThePBone.MprisClient? _client; + + private readonly MprisClient? _client; public MediaKeyRemote() { try { - _client = new ThePBone.MprisClient(); + _client = new MprisClient(); } catch (PlatformNotSupportedException) { @@ -60,23 +63,6 @@ public void PlayPause() Log.Error($"{ex.ErrorName}: {ex.ErrorMessage}"); } } -#else - public void Play() - { - _dummy.Play(); - } - - public void Pause() - { - _dummy.Pause(); - } - - public void PlayPause() - { - _dummy.PlayPause(); - } - - private readonly IMediaKeyRemote _dummy = new Dummy.MediaKeyRemote(); -#endif } -} \ No newline at end of file +} +#endif \ No newline at end of file