pub struct Player {
pub stream: Stream,
pub resampler: Arc<RwLock<Option<Resampler>>>,
pub sample_rate: usize,
pub state: State,
pub songs: Index<Song>,
pub volume: u8,
}Fields§
§stream: Stream§resampler: Arc<RwLock<Option<Resampler>>>§sample_rate: usize§state: State§songs: Index<Song>§volume: u8Implementations§
Source§impl Player
impl Player
pub fn new( wanted_device: &str, volume: u8, songs: Index<Song>, elapsed: f32, ) -> Self
pub fn set_output_device(&mut self, device: &Device) -> Result<(), String>
pub fn update(&mut self) -> Result<(), String>
pub fn add_songs(&mut self, songs: &[Song]) -> Result<(), String>
pub fn previous(&mut self) -> Result<(), String>
pub fn next(&mut self) -> Result<(), String>
pub fn play_index(&mut self, i: usize) -> Result<(), String>
pub fn delete_index(&mut self, i: usize) -> Result<(), String>
pub fn clear(&mut self)
pub fn clear_except_playing(&mut self)
pub fn volume_up(&mut self)
pub fn volume_down(&mut self)
pub fn duration(&self) -> Duration
pub fn elapsed(&self) -> Duration
pub fn toggle_playback(&mut self) -> Result<(), String>
pub fn play(&mut self)
pub fn pause(&mut self)
pub fn seek_by(&mut self, time: f32) -> Result<(), String>
pub fn seek_to(&mut self, time: f32) -> Result<(), String>
pub fn is_playing(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Player
impl !RefUnwindSafe 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
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