[][src]Struct melody::MusicPlayer

pub struct MusicPlayer { /* fields omitted */ }

Music Player

Methods

impl MusicPlayer[src]

pub fn new(playlist: Playlist) -> Self[src]

Constructs a new MusicPlayer

pub fn shuffle(&mut self)[src]

Shuffle the order of the playlist

pub fn start(&mut self) -> Result<(), MelodyErrors>[src]

Plays the first song in the Queue if any Otherwise throws an error

pub fn resume(&mut self)[src]

Resume's the song Should only be used of the song was paused Or it messes with the song's progress counter

pub fn pause(&mut self)[src]

Pauses Song

pub fn stop(&mut self)[src]

Stop's currently playing song

pub fn play_next(&mut self)[src]

Play next Song in Queue TODO: Return something if there is nothing else

pub fn volume(&self) -> f32[src]

Returns the music players volume Volume percentage is represented as a decimal

pub fn set_volume(&mut self, volume: f32)[src]

Set the volume of the music player volume: Percentage as a decimal

pub fn lock(&self)[src]

Lock current thread until current song ends

pub fn queue(&self) -> &Vec<Song>[src]

List current songs in queue

pub fn status(&self) -> MusicPlayerStatus[src]

Return the music players status

pub fn quit(self)[src]

Quit the music player

Trait Implementations

impl Drop for MusicPlayer[src]

impl Display for MusicPlayer[src]

Auto Trait Implementations

impl Send for MusicPlayer

impl Sync for MusicPlayer

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]