MPRIS Server
Implement MPRIS D-Bus interface in your application.
This library provides the essential functionalities for implementing the MPRIS D-Bus interface. This enables your application to become discoverable and controllable by other MPRIS-compatible media controllers, including but not limited to GNOME Shell, KDE Plasma, and other libraries such as mpris.
This library supports all the following interfaces as defined in the specification:
- org.mpris.MediaPlayer2
- org.mpris.MediaPlayer2.Player
- org.mpris.MediaPlayer2.TrackList
- org.mpris.MediaPlayer2.Playlists
To implement these interfaces, this crate offers two flavors: you can either create your own struct and implement RootInterface and PlayerInterface (or with optional TrackListInterface and PlaylistsInterface), or you can use the ready-to-use mutable Player struct.
Examples
For more detailed examples, see also the examples directory.
Manual Implementation (via Server or LocalServer)
use future;
use ;
;
async
Ready-to-use Implementation (via Player)
If you want to create a simple player without having to implement the interfaces, you can use the ready-to-use Player struct that implements those interfaces internally. This struct is mutable, automatically emits properties changed signal, and allows you to connect to method and property setter calls.
However, Player currently only supports the more commonly used org.mpris.MediaPlayer2 and org.mpris.MediaPlayer2.Player interfaces.
use ;
async
License
Copyright 2023 Dave Patrick Caberto
This software is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at this site.