Crate mpris_async

Source
Expand description

§mpris-async

Async version of the mpris crate.

Provides async versions of PlayerEvents, PlayerFinder, and ProgressTracker.

§Get started

Easiest way to get started with mpris is using get_active_player and then using events::PlayerEventsStream to track changes.

Modules§

events
PlayerEventsStream handles when new player events are emitted by a given player. Alternatively, the class gives a reciever which can be used to track events.
fake_progress
Used to make crate::progress::ProgressStream possible. The code is identical to mpris’s Progress.
player
PlayerStream Handles player connections. It will try for a connection to a new mpris player forever.
progress
ProgressStream handles when changes to progress are sent.

Structs§

Metadata
A structured representation of the Player metadata.
Player
A MPRIS-compatible player.
Progress
Struct containing information about current progress of a Player.
TrackID
Represents the MPRIS Track_Id type.
TrackList
Represents a MediaPlayer2.TrackList.

Functions§

get_active_player
Gets the most active player. If no player exists, this function will wait until one does. Based of off PlayerFinder::find_active
get_first_player
Gets the first player. If no player exists, this function will wait until one does. Based of off PlayerFinder::find_first
get_players
Gets all of the avaliable players. If no player exists, this function will wait until one does. Every retry_delay milliseconds it will try for a new connection. Based of off PlayerFinder::find_all
stream_players
Creates a stream of Players. Unlike mpris::PlayerFinder::iter_players, this function will keep checking for more players forever.