#player #mpris #events #tokio #interface #callback #dbus

deprecated empris

DO NOT USE - Renamed to pris

1 unstable release

0.1.2 Jun 12, 2021
0.1.1 Jun 11, 2021
0.1.0 Jun 11, 2021

#16 in #mpris

Download history 6/week @ 2024-02-19 4/week @ 2024-02-26 58/week @ 2024-04-01

58 downloads per month

MIT license

18KB
284 lines

empris

A library for interfacing with MPRIS-compatible players, built in the tokio async runtime.


lib.rs:

This library provides a high-level interface to the MPRIS DBus specification.

It allows both controlling of a player, as well as listening for events and executing callbacks.

A basic player controller

use empris::{self, Player};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a connection to work with
    let conn = empris::get_connection();
    // Get a player under the name "vlc"
    let player = Player::try_new("vlc", &conn).await?;
    // Play/pause the player
    player.play_pause().await?;
}

This crate re-exports Message for use in typing non-closure callbacks.

Dependencies

~8–18MB
~245K SLoC