pub struct PlayerState {
pub position: usize,
pub player_position: Duration,
pub player_volume: PlayerVolume,
pub playback_state: PlaybackState,
pub tracks: Vec<Arc<Track>>,
pub shuffled_track_indices: Vec<usize>,
pub queue_source: QueueSource,
pub shuffle_state: ShuffleState,
pub loop_state: LoopState,
}Expand description
Data structure used to store playback state on the disc and in the RAM at runtime.
Fields§
§position: usizeThe index of the current track.
It can either point to the tracks variable or shuffled_tracks is shuffle is supported
and set to ShuffleState::On.
player_position: Duration§player_volume: PlayerVolume§playback_state: PlaybackState§tracks: Vec<Arc<Track>>§shuffled_track_indices: Vec<usize>§queue_source: QueueSource§shuffle_state: ShuffleState§loop_state: LoopStateImplementations§
Source§impl PlayerState
impl PlayerState
pub fn queue_empty(&self) -> bool
pub fn current(&self) -> Option<&Arc<Track>>
Sourcepub fn real_track_index(&self, index: usize) -> Option<usize>
pub fn real_track_index(&self, index: usize) -> Option<usize>
pub fn can_seek(&self) -> bool
pub fn can_play(&self) -> bool
pub fn can_pause(&self) -> bool
pub fn can_toggle_playing(&self) -> bool
pub fn can_go_next(&self) -> bool
pub fn can_go_previous(&self) -> bool
pub fn is_playing(&self) -> bool
pub fn is_paused(&self) -> bool
pub fn stopped(&self) -> bool
pub fn shuffle_enabled(&self) -> bool
pub fn handle_event(&mut self, event: Event)
Trait Implementations§
Source§impl Clone for PlayerState
impl Clone for PlayerState
Source§impl Debug for PlayerState
impl Debug for PlayerState
Source§impl Default for PlayerState
impl Default for PlayerState
Source§impl PartialEq for PlayerState
impl PartialEq for PlayerState
impl StructuralPartialEq for PlayerState
Auto Trait Implementations§
impl Freeze for PlayerState
impl RefUnwindSafe for PlayerState
impl Send for PlayerState
impl Sync for PlayerState
impl Unpin for PlayerState
impl UnsafeUnpin for PlayerState
impl UnwindSafe for PlayerState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> 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> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().