Struct gonk_player::Player
source · [−]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: u8
Implementations
sourceimpl 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
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more