pub struct Periodic<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> Periodic<'a>
impl<'a> Periodic<'a>
Sourcepub fn custom(data: &'a [i16]) -> Periodic<'a>
pub fn custom(data: &'a [i16]) -> Periodic<'a>
Creates a custom waveform effect.
The device has to advertise support for Feature::CUSTOM for this to work.
§Panics
Panics when data is longer than u32::MAX elements.
In practice, no device will accept a waveform that large anyways.
pub fn with_envelope(self, env: Envelope) -> Self
pub fn with_offset(self, offset: i16) -> Self
pub fn with_phase(self, phase: u16) -> Self
pub fn magnitude(&self) -> i16
Sourcepub fn phase(&self) -> u16
pub fn phase(&self) -> u16
The horizontal phase offset in the effect’s Waveform where playback will begin.
pub fn envelope(&self) -> Envelope
Sourcepub fn custom_data(&self) -> Option<&'a [i16]>
pub fn custom_data(&self) -> Option<&'a [i16]>
If this effect has type Waveform::CUSTOM, returns a reference to the custom waveform
data.
Also see Periodic::custom for how to create such an effect.
Trait Implementations§
impl<'a> Copy for Periodic<'a>
impl Eq for Periodic<'_>
Auto Trait Implementations§
impl<'a> Freeze for Periodic<'a>
impl<'a> RefUnwindSafe for Periodic<'a>
impl<'a> Send for Periodic<'a>
impl<'a> Sync for Periodic<'a>
impl<'a> Unpin for Periodic<'a>
impl<'a> UnwindSafe for Periodic<'a>
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