Skip to content

Commit

Permalink
Fix Mpris
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed May 9, 2022
1 parent 3bad273 commit ce99864
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions GalaxyBudsClient/Platform/Linux/MediaKeyRemote.Linux.cs
Original file line number Diff line number Diff line change
@@ -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)
{
Expand Down Expand Up @@ -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
}
}
}
#endif

0 comments on commit ce99864

Please sign in to comment.