pub trait LocalPlaylistsInterface: LocalPlayerInterface {
    // Required methods
    fn activate_playlist<'life0, 'async_trait>(
        &'life0 self,
        playlist_id: PlaylistId
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_playlists<'life0, 'async_trait>(
        &'life0 self,
        index: u32,
        max_count: u32,
        order: PlaylistOrdering,
        reverse_order: bool
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Playlist>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn playlist_count<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<u32>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn orderings<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PlaylistOrdering>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn active_playlist<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<MaybePlaylist>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Local version of PlaylistsInterface to be used with LocalServer.

Used to implement org.mpris.MediaPlayer2.Playlists interface, which provides access to the media player’s playlists.

Since D-Bus does not provide an easy way to check for what interfaces are exported on an object, clients should attempt to get one of the properties on this interface to see if it is implemented.

Required Methods§

source

fn activate_playlist<'life0, 'async_trait>( &'life0 self, playlist_id: PlaylistId ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Starts playing the given playlist.

Parameters
  • playlist_id - The id of the playlist to activate.

Note that this must be implemented. If the media player does not allow clients to change the playlist, it should not implement this interface at all.

It is up to the media player whether this completely replaces the current tracklist, or whether it is merely inserted into the tracklist and the first track starts. For example, if the media player is operating in a “jukebox” mode, it may just append the playlist to the list of upcoming tracks, and skip to the first track in the playlist.

source

fn get_playlists<'life0, 'async_trait>( &'life0 self, index: u32, max_count: u32, order: PlaylistOrdering, reverse_order: bool ) -> Pin<Box<dyn Future<Output = Result<Vec<Playlist>>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Gets a set of playlists.

Parameters
  • index - The index of the first playlist to be fetched (according to the ordering).
  • max_count - The maximum number of playlists to fetch.
  • order - The ordering that should be used.
  • reverse_order - Whether the order should be reversed.
Returns
  • playlists - A list of (at most max_count) playlists.
source

fn playlist_count<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<u32>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

The number of playlists available.

When this property changes, the org.freedesktop.DBus.Properties.PropertiesChanged signal via playlists_properties_changed must be emitted with the new value.

source

fn orderings<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PlaylistOrdering>>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

The available orderings. At least one must be offered.

When this property changes, the org.freedesktop.DBus.Properties.PropertiesChanged signal via playlists_properties_changed must be emitted with the new value.

Rationale

Media players may not have access to all the data required for some orderings. For example, creation times are not available on UNIX filesystems (don’t let the ctime fool you!). On the other hand, clients should have some way to get the “most recent” playlists.

source

fn active_playlist<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<MaybePlaylist>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

The currently-active playlist.

When this property changes, the org.freedesktop.DBus.Properties.PropertiesChanged signal via playlists_properties_changed must be emitted with the new value.

If there is no currently-active playlist, the structure’s Valid field will be false, and the playlist details are undefined.

Note that this may not have a value even after ActivatePlaylist is called with a valid playlist id as ActivatePlaylist implementations have the option of simply inserting the contents of the playlist into the current tracklist.

Implementors§