FichteFoll / discordrp-mpris

Discord Rich Presence through media players providing the mpris2 dbus interface
MIT License
86 stars 19 forks source link

Switch to or add option for event-based monitoring #10

Open FichteFoll opened 4 years ago

FichteFoll commented 4 years ago

The dbus protocol provides an observable property change event that we can monitor in case anything in the player (besides playback position) changes. trackma uses this.

We would still provide the poll-based version as a fallback for players that don't properly implement it (and especially considering how it's already implemented), but well-behaving citizens use events where they can.

I don't know how well this works with dbussy's async backend, but I prefer to keep using it.

FichteFoll commented 1 year ago

I've used jeepney for a different project recently (trackma) and very much liked its low-level API, allowing precise control of the dbus interactions and providing several IO implementations, including asyncio. I'll be switching to it when implementing a signal-based approach some time in the future.