#[repr(C)]pub struct MediaControlRequest {
pub uri: AzString,
pub track_id: AzString,
pub position_us: i64,
pub kind: MediaControlKind,
pub volume: f32,
}Expand description
One inbound request from the platform’s media controls (9h-i-a-i-a): a
desktop scrubber, a lock-screen slider, playerctl position 30, a volume
slider in the desktop’s media widget.
Unlike the transport commands, which become media KEY events, these carry
a value - a position, a URI, a volume - which is why they are their own
event kind (EventType::MediaControl) with their own data rather than a
key code.
Fields§
§uri: AzStringThe URI for OpenUri, empty otherwise.
track_id: AzStringFor SeekAbsolute: the track id the request was made against, so an
app can drop a seek meant for a track that has since ended - MPRIS
says exactly that about SetPosition. Empty when the platform gave
none.
position_us: i64Microseconds, the MPRIS unit; relative for SeekRelative, absolute for
SeekAbsolute, 0 otherwise.
kind: MediaControlKind§volume: f32For SetVolume: the requested volume, 0.0..1.0. 0.0 otherwise.
Trait Implementations§
Source§impl Clone for MediaControlRequest
impl Clone for MediaControlRequest
Source§fn clone(&self) -> MediaControlRequest
fn clone(&self) -> MediaControlRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more