pub struct PlaybackRate { /* private fields */ }Expand description
The speed at which tracks are played.
Rate of 1.0 will play tracks at their original speed, 2.0 will play them twice as fast, and
0.5 will slow them to half speed.
Implementations§
Source§impl PlaybackRate
impl PlaybackRate
Sourcepub fn new(rate: f64, min: f64, max: f64) -> PlaybackRate
pub fn new(rate: f64, min: f64, max: f64) -> PlaybackRate
Create a new PlaybackRate struct.
Sourcepub fn is_in_range(&self, rate: f64) -> bool
pub fn is_in_range(&self, rate: f64) -> bool
Checks if the given rate value is in the allowed range.
Sourcepub fn set_value(&mut self, rate: f64)
pub fn set_value(&mut self, rate: f64)
Set the rate multiplier.
This value will be clamped with the min and max values.
Sourcepub fn get_value_f32(&self) -> f32
pub fn get_value_f32(&self) -> f32
Get the rate multiplier clamped to f32.
Trait Implementations§
Source§impl Clone for PlaybackRate
impl Clone for PlaybackRate
Source§fn clone(&self) -> PlaybackRate
fn clone(&self) -> PlaybackRate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlaybackRate
impl Debug for PlaybackRate
Source§impl Default for PlaybackRate
impl Default for PlaybackRate
Source§impl<'de> Deserialize<'de> for PlaybackRate
impl<'de> Deserialize<'de> for PlaybackRate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PlaybackRate
impl Display for PlaybackRate
Source§impl PartialEq for PlaybackRate
impl PartialEq for PlaybackRate
Source§fn eq(&self, other: &PlaybackRate) -> bool
fn eq(&self, other: &PlaybackRate) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PlaybackRate
impl Serialize for PlaybackRate
impl Copy for PlaybackRate
impl StructuralPartialEq for PlaybackRate
Auto Trait Implementations§
impl Freeze for PlaybackRate
impl RefUnwindSafe for PlaybackRate
impl Send for PlaybackRate
impl Sync for PlaybackRate
impl Unpin for PlaybackRate
impl UnsafeUnpin for PlaybackRate
impl UnwindSafe for PlaybackRate
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