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

The track metadata at the point in time that this Progress was constructed.

The playback status at the point in time that this Progress was constructed.

Methods

impl Progress
[src]

[src]

Returns the length of the current track as a 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.

[src]

Returns the position that the current track was at when the Progress was created.

[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.

[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.

Trait Implementations

impl Debug for Progress
[src]

[src]

Formats the value using the given formatter.