Expand description
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 pris::{self, Player};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a connection to work with
let conn = pris::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.
Re-exports§
pub use dbus::message::Message;
Modules§
- methods
- Provides all of the methods needed to control and
work with a
Player.
Structs§
- Event
Manager - A struct that simplifies the process of adding
and removing listeners and callbacks to/from MPRIS
DBussignals. - Player
- A struct used to control an MPRIS player.
Enums§
- Event
Type - Enum for indicating which type of MPRIS event to listen for.
Functions§
- get_
all_ players - Gets a
VecofPlayers from all active MPRIS players found on theDBus. - get_
connection - Establishes a connection to the
DBus. Use this to create a connection to pass intoPlayer. - prop_
cast - Gets a value from a HashMap, and casts it to the type provided.