[−][src]Struct melody::MusicPlayer
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]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,