Skip to main content

QueuePlayer

Struct QueuePlayer 

Source
pub struct QueuePlayer { /* private fields */ }

Implementations§

Source§

impl QueuePlayer

Source

pub fn new() -> Self

Source

pub fn add_queue_track(&mut self, track: QueueTrack)

Source

pub fn add_format( &mut self, format: Arc<Mutex<Box<dyn FormatReader>>>, name: String, )

Source

pub fn add_track(&mut self, track: MusicTrack)

Source

pub fn add<P>(&mut self, path: P) -> Result<(), Box<dyn Error>>
where P: AsRef<OsStr> + AsRef<Path>,

Source

pub fn remove(&mut self, index: usize)

Source

pub fn clear(&mut self)

Source

pub fn shuffle(&mut self)

Source

pub fn current_track_name(&self) -> &str

Source

pub fn play(&mut self, index: usize)

Source

pub fn play_next(&mut self)

Source

pub fn play_previous(&mut self)

Source

pub fn get_index_from_track_name(&self, name: &str) -> Result<usize, NError>

Source

pub fn get_duration_for_track(&self, index: usize) -> TrackTime

Methods from Deref<Target = Player>§

Source

pub fn pause(&mut self) -> Result<(), SendError<Message>>

Pauses the current playing track, if any It only errors if it can’t send the message (so something serious may have happened)

Source

pub fn unpause(&mut self) -> Result<(), SendError<Message>>

Unpauses the current playing track, if any It only errors if it can’t send the message (so something serious may have happened)

Source

pub fn is_paused(&self) -> bool

Returns whether the current track is paused It’ll always return false if there isn’t any track playing

Source

pub fn set_volume(&mut self, volume: f32) -> Result<(), SendError<Message>>

Sets the output volume It only errors if it can’t send the message (so something serious may have happened)

Source

pub fn set_playback_speed( &mut self, playback_speed: f32, ) -> Result<(), SendError<Message>>

Sets the output volume It only errors if it can’t send the message (so something serious may have happened)

Source

pub fn seek_to(&self, secs: u64, frac: f64) -> Result<(), SendError<Message>>

Seeks to the set timestamp Be aware that if the timestamp isn’t valid the track thread will panic It only errors if it can’t send the message (so something serious may have happened)

Source

pub fn get_time(&mut self) -> Option<TrackTime>

Returns the timestamp that was lastly sent by the track thread

Source

pub fn has_ended(&self) -> bool

Returns whether the track thread has sent Message::End, thus stopping the execution by itself This will return false if you called Player::end_current beforehand

Source

pub fn is_playing(&self) -> bool

Returns whether if any track is playing Note that this function doesn’t check if the track is paused or not

Source

pub fn end_current(&self) -> Result<(), SendError<Message>>

Ends the current track playing, if any It only errors if it can’t send the message (so something serious may have happened)

Source

pub fn play_from_path<P>(&mut self, path: P) -> Result<(), Box<dyn Error>>
where P: AsRef<OsStr> + AsRef<Path>,

Plays a certain track given its file path

Source

pub fn play_from_track(&mut self, track: &MusicTrack)

Plays a certain track

Source

pub fn play(&mut self, format: Arc<Mutex<Box<dyn FormatReader>>>)

Plays a certain track given its format

Trait Implementations§

Source§

impl Deref for QueuePlayer

Source§

type Target = Player

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for QueuePlayer

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V