MPRIS2 Types

class mpris2.types.Loop_Status(status)[source]

A repeat / loop status

  • None (None)

    The playback will stop when there are no more tracks to play

  • Track (Track)

    The current track will start again from the begining once it has finished playing

  • Playlist (Playlist)

    The playback loops through a list of tracks

class mpris2.types.Metadata_Map(metadata)[source]

A mapping from metadata attribute names to values.

The mpris:trackid attribute must always be present. This contains a string that uniquely identifies the track within the scope of the playlist.

If the length of the track is known, it should be provided in the metadata property with the ‘mpris:length’ key. The length must be given in microseconds, and be represented as a signed 64-bit integer.

If there is an image associated with the track, a URL for it may be provided using the ‘mpris:artUrl’ key. For other metadata, fields defined by the Xesam ontology should be used, prefixed by ‘xesam:’. See for a list of common fields.

Lists of strings should be passed using the array-of-string (‘as’) D-Bus type. Dates should be passed as strings using the ISO 8601 extended format (eg: 2007-04-29T14:35:51). If the timezone is known, RFC 3339’s internet profile should be used (eg: 2007-04-29T14:35:51+02:00).

class mpris2.types.Playback_Rate(rate=1.0)[source]

A playback rate

This is a multiplier, so a value of 0.5 indicates that playback is happening at half speed, while 1.5 means that 1.5 seconds of ‘track time’ is consumed every second.

class mpris2.types.Playback_Status(status)[source]

A playback state.

  • Playing (Playing)

    A track is currently playing.

  • Paused (Paused)

    A track is currently paused.

  • Stopped (Stopped)

    There is no track currently playing.

class mpris2.types.Playlist(playlist)[source]

A data structure describing a playlist.

  • Id - o (Playlist_Id)

    A unique identifier for the playlist.

    This should remain the same if the playlist is renamed.

  • Name - s

    The name of the playlist, typically given by the user.

  • Icon - s (Uri)

    The URI of an (optional) icon.

class mpris2.types.Maybe_Playlist(maybe_playlist=None)[source]
  • Valid - b

    Whether this structure refers to a valid playlist.

  • Playlist - (oss) (Playlist)

    The playlist, providing Valid is true, otherwise undefined.

When constructing this type, it should be noted that the playlist ID must be a valid object path, or D-Bus implementations may reject it. This is true even when Valid is false. It is suggested that ‘/’ is used as the playlist ID in this case.

class mpris2.types.Playlist_Id(playlist_id)[source]

Unique playlist identifier.

class mpris2.types.Playlist_Ordering(ordering)[source]

Specifies the ordering of returned playlists.

  • Alphabetical (Alphabetical)

    Alphabetical ordering by name, ascending.

  • CreationDate (Created)

    Ordering by creation date, oldest first.

  • ModifiedDate (Modified)

    Ordering by last modified date, oldest first.

  • LastPlayDate (Played)

    Ordering by date of last playback, oldest first.

  • UserDefined (User)

    A user-defined ordering.

class mpris2.types.Time_In_Us(time=0)[source]

Time in microseconds.

class mpris2.types.Uri(uri)[source]

A unique resource identifier.

class mpris2.types.Volume(volume=1.0)[source]

Audio volume level

  • 0.0 means mute.
  • 1.0 is a sensible maximum volume level (ex: 0dB).

Note that the volume may be higher than 1.0, although generally clients should not attempt to set it above 1.0.