1 unstable release
0.1.2 | Jun 12, 2021 |
---|---|
0.1.1 |
|
0.1.0 |
|
#16 in #mpris
58 downloads per month
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