Struct mpris_server::Player
source · pub struct Player { /* private fields */ }
Expand description
Ready-to-use mutable service-side object that internally implements
LocalRootInterface
and LocalPlayerInterface
.
This has its own internal state, automatically emits properties changed signals, and allows you to connect to method and property setter calls.
If you need more control to the implementation, you can use LocalServer
or Server
directly instead.
Implementations§
source§impl Player
impl Player
pub fn builder(bus_name_suffix: &str) -> PlayerBuilder
sourcepub fn run(&self) -> LocalServerRunTask ⓘ
pub fn run(&self) -> LocalServerRunTask ⓘ
Returns a task that runs the player’s server until the player and the task is dropped.
The task must be awaited as soon as possible after creating the player.
The returned task is no-op if the player’s server has been ran before.
pub fn connect_raise(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_quit(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_set_fullscreen(&self, cb: impl Fn(&Self, bool) + 'static)
pub fn can_quit(&self) -> bool
pub async fn set_can_quit(&self, can_quit: bool) -> Result<()>
pub fn fullscreen(&self) -> bool
pub async fn set_fullscreen(&self, fullscreen: bool) -> Result<()>
pub fn can_set_fullscreen(&self) -> bool
pub async fn set_can_set_fullscreen( &self, can_set_fullscreen: bool, ) -> Result<()>
pub fn can_raise(&self) -> bool
pub async fn set_can_raise(&self, can_raise: bool) -> Result<()>
pub fn has_track_list(&self) -> bool
pub async fn set_has_track_list(&self, has_track_list: bool) -> Result<()>
pub fn identity(&self) -> Ref<'_, String>
pub async fn set_identity(&self, identity: impl Into<String>) -> Result<()>
pub fn desktop_entry(&self) -> Ref<'_, String>
pub async fn set_desktop_entry( &self, desktop_entry: impl Into<String>, ) -> Result<()>
pub fn supported_uri_schemes(&self) -> Ref<'_, Vec<String>>
pub async fn set_supported_uri_schemes( &self, supported_uri_schemes: impl IntoIterator<Item = impl Into<String>>, ) -> Result<()>
pub fn supported_mime_types(&self) -> Ref<'_, Vec<String>>
pub async fn set_supported_mime_types( &self, supported_mime_types: impl IntoIterator<Item = impl Into<String>>, ) -> Result<()>
pub fn connect_next(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_previous(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_pause(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_play_pause(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_stop(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_play(&self, cb: impl Fn(&Self) + 'static)
pub fn connect_seek(&self, cb: impl Fn(&Self, Time) + 'static)
pub fn connect_set_position(&self, cb: impl Fn(&Self, &TrackId, Time) + 'static)
pub fn connect_open_uri(&self, cb: impl Fn(&Self, &str) + 'static)
pub fn connect_set_loop_status(&self, cb: impl Fn(&Self, LoopStatus) + 'static)
pub fn connect_set_rate(&self, cb: impl Fn(&Self, PlaybackRate) + 'static)
pub fn connect_set_shuffle(&self, cb: impl Fn(&Self, bool) + 'static)
pub fn connect_set_volume(&self, cb: impl Fn(&Self, Volume) + 'static)
pub async fn seeked(&self, position: Time) -> Result<()>
pub fn playback_status(&self) -> PlaybackStatus
pub async fn set_playback_status( &self, playback_status: PlaybackStatus, ) -> Result<()>
pub fn loop_status(&self) -> LoopStatus
pub async fn set_loop_status(&self, loop_status: LoopStatus) -> Result<()>
pub fn rate(&self) -> PlaybackRate
pub async fn set_rate(&self, rate: PlaybackRate) -> Result<()>
pub fn shuffle(&self) -> bool
pub async fn set_shuffle(&self, shuffle: bool) -> Result<()>
pub fn metadata(&self) -> Ref<'_, Metadata>
pub async fn set_metadata(&self, metadata: Metadata) -> Result<()>
pub fn volume(&self) -> Volume
pub async fn set_volume(&self, volume: Volume) -> Result<()>
pub fn position(&self) -> Time
sourcepub fn set_position(&self, position: Time)
pub fn set_position(&self, position: Time)
This does not emit PropertiesChanged
signal.
pub fn minimum_rate(&self) -> PlaybackRate
pub async fn set_minimum_rate(&self, minimum_rate: PlaybackRate) -> Result<()>
pub fn maximum_rate(&self) -> PlaybackRate
pub async fn set_maximum_rate(&self, maximum_rate: PlaybackRate) -> Result<()>
pub fn can_go_next(&self) -> bool
pub async fn set_can_go_next(&self, can_go_next: bool) -> Result<()>
pub fn can_go_previous(&self) -> bool
pub async fn set_can_go_previous(&self, can_go_previous: bool) -> Result<()>
pub fn can_play(&self) -> bool
pub async fn set_can_play(&self, can_play: bool) -> Result<()>
pub fn can_pause(&self) -> bool
pub async fn set_can_pause(&self, can_pause: bool) -> Result<()>
pub fn can_seek(&self) -> bool
pub async fn set_can_seek(&self, can_seek: bool) -> Result<()>
sourcepub fn can_control(&self) -> bool
pub fn can_control(&self) -> bool
This can only be set on construct.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Player
impl !RefUnwindSafe for Player
impl !Send for Player
impl !Sync for Player
impl Unpin for Player
impl !UnwindSafe for Player
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more