#[repr(C)]pub struct playdate_sound_envelope {
pub newEnvelope: Option<unsafe extern "C" fn(attack: c_float, decay: c_float, sustain: c_float, release: c_float) -> *mut PDSynthEnvelope>,
pub freeEnvelope: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope)>,
pub setAttack: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, attack: c_float)>,
pub setDecay: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, decay: c_float)>,
pub setSustain: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, sustain: c_float)>,
pub setRelease: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, release: c_float)>,
pub setLegato: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, flag: c_int)>,
pub setRetrigger: Option<unsafe extern "C" fn(lfo: *mut PDSynthEnvelope, flag: c_int)>,
pub getValue: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope) -> c_float>,
pub setCurvature: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, amount: c_float)>,
pub setVelocitySensitivity: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, velsens: c_float)>,
pub setRateScaling: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, scaling: c_float, start: MIDINote, end: MIDINote)>,
}Fields§
§newEnvelope: Option<unsafe extern "C" fn(attack: c_float, decay: c_float, sustain: c_float, release: c_float) -> *mut PDSynthEnvelope>PDSynthEnvelope* playdate->sound->envelope->newEnvelope(float attack, float decay, float sustain, float release)
Creates a new envelope with the given parameters.
freeEnvelope: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope)>void playdate->sound->envelope->freeEnvelope(PDSynthEnvelope* env)
Frees the envelope.
setAttack: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, attack: c_float)>void playdate->sound->envelope->setAttack(PDSynthEnvelope* env, float attack)
setDecay: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, decay: c_float)>void playdate->sound->envelope->setDecay(PDSynthEnvelope* env, float decay)
setSustain: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, sustain: c_float)>void playdate->sound->envelope->setSustain(PDSynthEnvelope* env, float sustain)
setRelease: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, release: c_float)>void playdate->sound->envelope->setRelease(PDSynthEnvelope* env, float release)
Sets the ADSR parameters of the envelope.
setLegato: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, flag: c_int)>void playdate->sound->envelope->setLegato(PDSynthEnvelope* env, int flag)
Sets whether to use legato phrasing for the envelope. If the legato flag is set, when the envelope is re-triggered before it’s released, it remains in the sustain phase instead of jumping back to the attack phase.
setRetrigger: Option<unsafe extern "C" fn(lfo: *mut PDSynthEnvelope, flag: c_int)>void playdate->sound->envelope->setRetrigger(PDSynthEnvelope* env, int flag)
If retrigger is on, the envelope always starts from 0 when a note starts playing, instead of the current value if it’s active.
getValue: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope) -> c_float>float playdate->sound->envelope->getValue(PDSynthEnvelope* env)
Return the current output value of the envelope.
setCurvature: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, amount: c_float)>void playdate->sound->envelope->setCurvature(PDSynthEnvelope* env, float amount)
Smoothly changes the envelope’s shape from linear (amount=0) to exponential (amount=1).
setVelocitySensitivity: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, velsens: c_float)>void playdate->sound->envelope->setVelocitySensitivity(PDSynthEnvelope* env, float velsens)
Changes the amount by which note velocity scales output level. At the default value of 1, output is proportional to velocity; at 0 velocity has no effect on output level.
setRateScaling: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, scaling: c_float, start: MIDINote, end: MIDINote)>void playdate->sound->envelope->setRateScaling(PDSynthEnvelope* env, float scaling, MIDINote start, MIDINote end)
Scales the envelope rate according to the played note. For notes below start, the envelope’s set rate is used; for notes above end envelope rates are scaled by the scaling parameter. Between the two notes the scaling factor is interpolated from 1.0 to scaling.
Trait Implementations§
Source§impl Clone for playdate_sound_envelope
impl Clone for playdate_sound_envelope
Source§fn clone(&self) -> playdate_sound_envelope
fn clone(&self) -> playdate_sound_envelope
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for playdate_sound_envelope
impl Debug for playdate_sound_envelope
Source§impl Default for playdate_sound_envelope
impl Default for playdate_sound_envelope
Source§fn default() -> playdate_sound_envelope
fn default() -> playdate_sound_envelope
Source§impl Hash for playdate_sound_envelope
impl Hash for playdate_sound_envelope
Source§impl Ord for playdate_sound_envelope
impl Ord for playdate_sound_envelope
Source§impl PartialEq for playdate_sound_envelope
impl PartialEq for playdate_sound_envelope
Source§impl PartialOrd for playdate_sound_envelope
impl PartialOrd for playdate_sound_envelope
Source§fn partial_cmp(&self, other: &playdate_sound_envelope) -> Option<Ordering>
fn partial_cmp(&self, other: &playdate_sound_envelope) -> Option<Ordering>
impl Copy for playdate_sound_envelope
impl Eq for playdate_sound_envelope
impl StructuralPartialEq for playdate_sound_envelope
Auto Trait Implementations§
impl Freeze for playdate_sound_envelope
impl RefUnwindSafe for playdate_sound_envelope
impl Send for playdate_sound_envelope
impl Sync for playdate_sound_envelope
impl Unpin for playdate_sound_envelope
impl UnwindSafe for playdate_sound_envelope
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes