#[repr(C)]pub enum Command {
SetWaveform(usize),
SetFrequency(f32),
SetAmplitude(f32),
SetPanning(f32),
SetCustomWaveform(CustomWaveform),
SetPhase(f32),
ForceSetAmplitude(f32),
ForceSetPanning(f32),
FrequencySlide(f32, f32),
AmplitudeSlide(f32, f32),
PanningSlide(f32, f32),
}Expand description
The different types of commands that can be sent to channels.
Variants§
SetWaveform(usize)
An instruction to set the waveform of the channel.
| Index | Type |
|---|---|
| 0 | Sine |
| 1 | Triangle |
| 2 | Rectified Sine |
| 3 | Saw |
| 4 | Square |
| 5 | Pulse |
| 6 | Noise |
| 7 | Custom |
SetFrequency(f32)
An instruction to set the frequency of the channel in hertz.
SetAmplitude(f32)
An instruction to set the amplitude of the channel on a scale of 0..1
SetPanning(f32)
An instruction to set the panning of the channel on a scale of -1..1
SetCustomWaveform(CustomWaveform)
An instruction to change the custom waveform stored in the channel.
SetPhase(f32)
An instruction to set the phase of a waveform directly.
ForceSetAmplitude(f32)
An instruction to change the amplitude of the channel instantly, instead of softly.
ForceSetPanning(f32)
An instruction to change the panning of the channel instantly, instead of softly.
FrequencySlide(f32, f32)
An instruction to gradually change the frequency of the channel from its current state to a target state with the specified rate of change.
AmplitudeSlide(f32, f32)
An instruction to gradually change the amplitude of the channel from its current state to a target state with the specified rate of change.
PanningSlide(f32, f32)
An instruction to gradually change the panning of the channel from its current state to a target state with the specified rate of change.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
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>,
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more