#[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
sourceimpl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more