Struct MediaTransportProps
pub struct MediaTransportProps {Show 27 fields
pub title: String,
pub subtitle: Option<String>,
pub error: bool,
pub art: Option<PictureSource>,
pub art_name: Option<String>,
pub opens: Option<String>,
pub playing: bool,
pub idle: bool,
pub position: Option<f64>,
pub duration: Option<f64>,
pub volume: Option<f64>,
pub shuffle: Option<bool>,
pub repeat: Option<TransportRepeat>,
pub liked: Option<bool>,
pub lyrics: Option<bool>,
pub queue: Option<bool>,
pub act_play_pause: Event,
pub act_previous: Event,
pub act_next: Event,
pub act_shuffle: Event,
pub act_repeat: Event,
pub act_like: Event,
pub act_mute: Event,
pub act_seek: Event,
pub act_volume: Event,
pub act_lyrics: Event,
pub act_queue: Event,
}Expand description
What is playing and the controls that steer it, as one band: the art and the song, like and lyrics, shuffle, previous, play/pause, next and repeat over the scrubber, the queue and the volume. It stands across the window’s foot, under every column.
A control the view gives no event for is left out: an app that cannot shuffle shows no shuffle. A control the view leaves off changes what the band shows rather than what plays.
Fields§
§title: StringThe song’s name, or what the band says with nothing playing.
subtitle: Option<String>Who it is by, or why it cannot play.
error: boolThe subtitle says why it cannot play: it reads as an error.
art: Option<PictureSource>Its cover: a picture by its address, loaded as it arrives. Without one the placeholder shows the album’s initials.
art_name: Option<String>The name the placeholder cover takes its initials and colour from (the album).
opens: Option<String>What a press on the art opens (“Open album”, “Show lyrics”), as it is announced.
playing: boolWhether it plays.
idle: boolNothing can play: every control rests disabled.
position: Option<f64>Where it is, in seconds.
duration: Option<f64>How long it is, in seconds.
volume: Option<f64>The volume, 0..=1; zero is muted.
shuffle: Option<bool>Whether shuffle is on. Without it there is no shuffle control.
repeat: Option<TransportRepeat>What repeat repeats. Without it there is no repeat control.
liked: Option<bool>Whether what plays is liked. Without it there is no like control.
lyrics: Option<bool>Whether the lyrics show. Without it there is no lyrics control.
queue: Option<bool>Whether the queue shows. Without it there is no queue control.
act_play_pause: EventThe play/pause control was pressed.
act_previous: EventThe previous control was pressed.
act_next: EventThe next control was pressed.
act_shuffle: EventShuffle was toggled.
act_repeat: EventRepeat was toggled.
act_like: EventWhat plays was liked or unliked.
act_mute: EventThe band was muted or unmuted.
act_seek: EventThe band was moved to a place in the song: carries 0..=1.
act_volume: EventThe volume was set: carries 0..=1.
act_lyrics: EventThe lyrics were asked for.
act_queue: EventThe queue was asked for.
Implementations§
§impl MediaTransportProps
impl MediaTransportProps
pub fn state(&self) -> TransportState
pub fn state(&self) -> TransportState
What the band shows, as the view declares it.
pub fn triggers(&self) -> TransportTriggers
pub fn triggers(&self) -> TransportTriggers
What each control reports.
Trait Implementations§
§impl Component for MediaTransportProps
impl Component for MediaTransportProps
fn describe() -> Description
§fn from_source(source: &mut dyn Source) -> Result<MediaTransportProps, Error>
fn from_source(source: &mut dyn Source) -> Result<MediaTransportProps, Error>
source gives. Read more§impl Default for MediaTransportProps
impl Default for MediaTransportProps
§fn default() -> MediaTransportProps
fn default() -> MediaTransportProps
Auto Trait Implementations§
impl Freeze for MediaTransportProps
impl !RefUnwindSafe for MediaTransportProps
impl !Send for MediaTransportProps
impl !Sync for MediaTransportProps
impl Unpin for MediaTransportProps
impl UnsafeUnpin for MediaTransportProps
impl !UnwindSafe for MediaTransportProps
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more