pub struct TrackList { /* private fields */ }Expand description
Simplified access to the track list of an MPRIS media player.
Implementations§
Source§impl TrackList
impl TrackList
Sourcepub async fn new(connection: &Connection, name: OwnedBusName) -> Result<Self>
pub async fn new(connection: &Connection, name: OwnedBusName) -> Result<Self>
Creates a new instance of the org.mpris.MediaPlayer2.TrackList interface.
Sourcepub async fn add_track<S: ToString>(
&self,
uri: S,
after: TrackId,
set_as_current: bool,
) -> Result<()>
pub async fn add_track<S: ToString>( &self, uri: S, after: TrackId, set_as_current: bool, ) -> Result<()>
Adds a new track to this track list.
Methods from Deref<Target = TrackListProxy<'static>>§
Sourcepub async fn get_tracks_metadata(
&self,
track_ids: Vec<TrackId>,
) -> Result<Vec<Metadata>>
pub async fn get_tracks_metadata( &self, track_ids: Vec<TrackId>, ) -> Result<Vec<Metadata>>
GetTracksMetadata method
Sourcepub async fn add_track(
&self,
uri: &str,
after_track: TrackId,
set_as_current: bool,
) -> Result<()>
pub async fn add_track( &self, uri: &str, after_track: TrackId, set_as_current: bool, ) -> Result<()>
AddTrack method
Sourcepub async fn remove_track(&self, track_id: TrackId) -> Result<()>
pub async fn remove_track(&self, track_id: TrackId) -> Result<()>
RemoveTrack method
Sourcepub async fn receive_track_list_replaced(
&self,
) -> Result<TrackListReplacedStream>
pub async fn receive_track_list_replaced( &self, ) -> Result<TrackListReplacedStream>
Create a stream that receives TrackListReplaced signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
TrackListReplaced signal
Indicates that the entire tracklist has been replaced.
It is left up to the implementation to decide when a change to the track list is invasive enough that this signal should be emitted instead of a series of TrackAdded and TrackRemoved signals.
/org/mpris/MediaPlayer2/TrackList/NoTrack indicates that there is no current track.
Sourcepub async fn receive_track_list_replaced_with_args(
&self,
args: &[(u8, &str)],
) -> Result<TrackListReplacedStream>
pub async fn receive_track_list_replaced_with_args( &self, args: &[(u8, &str)], ) -> Result<TrackListReplacedStream>
Create a stream that receives TrackListReplaced signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
TrackListReplaced signal
Indicates that the entire tracklist has been replaced.
It is left up to the implementation to decide when a change to the track list is invasive enough that this signal should be emitted instead of a series of TrackAdded and TrackRemoved signals.
/org/mpris/MediaPlayer2/TrackList/NoTrack indicates that there is no current track.
Sourcepub async fn receive_track_added(&self) -> Result<TrackAddedStream>
pub async fn receive_track_added(&self) -> Result<TrackAddedStream>
Create a stream that receives TrackAdded signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
TrackAdded signal
Indicates that a track has been added to the track list.
Sourcepub async fn receive_track_added_with_args(
&self,
args: &[(u8, &str)],
) -> Result<TrackAddedStream>
pub async fn receive_track_added_with_args( &self, args: &[(u8, &str)], ) -> Result<TrackAddedStream>
Create a stream that receives TrackAdded signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
TrackAdded signal
Indicates that a track has been added to the track list.
Sourcepub async fn receive_track_removed(&self) -> Result<TrackRemovedStream>
pub async fn receive_track_removed(&self) -> Result<TrackRemovedStream>
Create a stream that receives TrackRemoved signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
TrackRemoved signal
Indicates that a track has been removed from the track list.
Sourcepub async fn receive_track_removed_with_args(
&self,
args: &[(u8, &str)],
) -> Result<TrackRemovedStream>
pub async fn receive_track_removed_with_args( &self, args: &[(u8, &str)], ) -> Result<TrackRemovedStream>
Create a stream that receives TrackRemoved signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
TrackRemoved signal
Indicates that a track has been removed from the track list.
Sourcepub async fn receive_track_metadata_changed(
&self,
) -> Result<TrackMetadataChangedStream>
pub async fn receive_track_metadata_changed( &self, ) -> Result<TrackMetadataChangedStream>
Create a stream that receives TrackMetadataChanged signals.
This a convenient wrapper around zbus::Proxy::receive_signal.
TrackMetadataChanged signal
Indicates that the metadata of a track in the tracklist has changed.
This may indicate that a track has been replaced, in which case the mpris:trackid metadata entry is different from the track argument.
Sourcepub async fn receive_track_metadata_changed_with_args(
&self,
args: &[(u8, &str)],
) -> Result<TrackMetadataChangedStream>
pub async fn receive_track_metadata_changed_with_args( &self, args: &[(u8, &str)], ) -> Result<TrackMetadataChangedStream>
Create a stream that receives TrackMetadataChanged signals.
This a convenient wrapper around zbus::Proxy::receive_signal_with_args.
TrackMetadataChanged signal
Indicates that the metadata of a track in the tracklist has changed.
This may indicate that a track has been replaced, in which case the mpris:trackid metadata entry is different from the track argument.
Sourcepub fn cached_tracks(
&self,
) -> Result<Option<<Result<Vec<TrackId>> as ResultAdapter>::Ok>, <Result<Vec<TrackId>> as ResultAdapter>::Err>
pub fn cached_tracks( &self, ) -> Result<Option<<Result<Vec<TrackId>> as ResultAdapter>::Ok>, <Result<Vec<TrackId>> as ResultAdapter>::Err>
Tracks property
Get the cached value of the Tracks property, or None if the property is not cached.
Sourcepub async fn receive_tracks_changed(
&self,
) -> PropertyStream<'p, <Result<Vec<TrackId>> as ResultAdapter>::Ok>
pub async fn receive_tracks_changed( &self, ) -> PropertyStream<'p, <Result<Vec<TrackId>> as ResultAdapter>::Ok>
Tracks property
Create a stream for the Tracks property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.
Sourcepub async fn can_edit_tracks(&self) -> Result<bool>
pub async fn can_edit_tracks(&self) -> Result<bool>
CanEditTracks property
Sourcepub fn cached_can_edit_tracks(
&self,
) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>
pub fn cached_can_edit_tracks( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>
CanEditTracks property
Get the cached value of the CanEditTracks property, or None if the property is not cached.
Sourcepub async fn receive_can_edit_tracks_changed(
&self,
) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>
pub async fn receive_can_edit_tracks_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>
CanEditTracks property
Create a stream for the CanEditTracks property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.