pub enum SessionControlRequest {
Show 13 variants
Play {
control_handle: SessionControlControlHandle,
},
Pause {
control_handle: SessionControlControlHandle,
},
Stop {
control_handle: SessionControlControlHandle,
},
Seek {
position: i64,
control_handle: SessionControlControlHandle,
},
SkipForward {
control_handle: SessionControlControlHandle,
},
SkipReverse {
control_handle: SessionControlControlHandle,
},
NextItem {
control_handle: SessionControlControlHandle,
},
PrevItem {
control_handle: SessionControlControlHandle,
},
SetPlaybackRate {
playback_rate: f32,
control_handle: SessionControlControlHandle,
},
SetRepeatMode {
repeat_mode: RepeatMode,
control_handle: SessionControlControlHandle,
},
SetShuffleMode {
shuffle_on: bool,
control_handle: SessionControlControlHandle,
},
BindVolumeControl {
volume_control_request: ServerEnd<VolumeControlMarker>,
control_handle: SessionControlControlHandle,
},
WatchStatus {
responder: SessionControlWatchStatusResponder,
},
}
Expand description
Controls a media session and views its status.
The channel will close if the media session is stopped.
Variants§
Play
Plays media.
Fields
control_handle: SessionControlControlHandle
Pause
Pauses playback and retains position in media
Fields
control_handle: SessionControlControlHandle
Stop
Stops playback. The session should close.
Fields
control_handle: SessionControlControlHandle
Seek
Seeks to a specific position in media. Implementations are free to
enter an error state if the position is out of bounds. position
is an offset from the beginning of the media.
SkipForward
Skips forward in media by the player’s default skip amount.
Fields
control_handle: SessionControlControlHandle
SkipReverse
Skips in reverse in media by the player’s default skip amount.
Fields
control_handle: SessionControlControlHandle
NextItem
Changes media to the next item (e.g. next song in playlist).
Fields
control_handle: SessionControlControlHandle
PrevItem
Changes media to the previous item.
Fields
control_handle: SessionControlControlHandle
SetPlaybackRate
Sets the playback rate of the media. This will not change the playback mode.
SetRepeatMode
Sets repeat mode to any of the supported repeat modes.
SetShuffleMode
Sets shuffle mode.
BindVolumeControl
Binds to the session’s volume control for control and notifications.
Fields
volume_control_request: ServerEnd<VolumeControlMarker>
control_handle: SessionControlControlHandle
WatchStatus
Watches the session status. Leave a request hanging to receive a reply when the session status changes. The first request will be answered immediately with the current state.
Fields
responder: SessionControlWatchStatusResponder
Implementations§
Source§impl SessionControlRequest
impl SessionControlRequest
pub fn into_play(self) -> Option<SessionControlControlHandle>
pub fn into_pause(self) -> Option<SessionControlControlHandle>
pub fn into_stop(self) -> Option<SessionControlControlHandle>
pub fn into_seek(self) -> Option<(i64, SessionControlControlHandle)>
pub fn into_skip_forward(self) -> Option<SessionControlControlHandle>
pub fn into_skip_reverse(self) -> Option<SessionControlControlHandle>
pub fn into_next_item(self) -> Option<SessionControlControlHandle>
pub fn into_prev_item(self) -> Option<SessionControlControlHandle>
pub fn into_set_playback_rate( self, ) -> Option<(f32, SessionControlControlHandle)>
pub fn into_set_repeat_mode( self, ) -> Option<(RepeatMode, SessionControlControlHandle)>
pub fn into_set_shuffle_mode( self, ) -> Option<(bool, SessionControlControlHandle)>
pub fn into_bind_volume_control( self, ) -> Option<(ServerEnd<VolumeControlMarker>, SessionControlControlHandle)>
pub fn into_watch_status(self) -> Option<SessionControlWatchStatusResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL