Struct mpris::Progress
[−]
[src]
pub struct Progress { pub metadata: Metadata, pub playback_status: PlaybackStatus, // some fields omitted }
Struct containing information about current progress of a Player.
It has access to the metadata of the current track, as well as information about the current position of the track.
It is up to you to decide on how outdated information you want to rely on when implementing progress rendering.
Fields
metadata: Metadata
The track metadata at the point in time that this Progress was constructed.
playback_status: PlaybackStatus
The playback status at the point in time that this Progress was constructed.
Methods
impl Progress
[src]
fn length(&self) -> Option<Duration>
[src]
Returns the length of the current track as a Duration
.
fn position(&self) -> Duration
[src]
Returns the current position of the current track as a Duration
.
This method will calculate the expected position of the track at the instant of the
invocation using the initial_position
and knowledge of how long ago that position was
determined.
Note: Some players might not support this. Spotify is one such example. You can test
for known problem players using the supports_position
method.
fn initial_position(&self) -> Duration
[src]
Returns the position that the current track was at when the Progress
was created.
fn supports_position(&self) -> bool
[src]
Returns false
if the current player is known to not support the position
field.
You can optionally use this in order to display an undetermined position, as an example.
fn age(&self) -> Duration
[src]
Returns the age of the data as a Duration
.
If the Progress
has a high age it is more likely to be out of date.