Struct playdate_sys::ffi::playdate_sound_lfo
source · #[repr(C)]pub struct playdate_sound_lfo {Show 14 fields
pub newLFO: Option<unsafe extern "C" fn(type_: LFOType) -> *mut PDSynthLFO>,
pub freeLFO: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO)>,
pub setType: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, type_: LFOType)>,
pub setRate: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, rate: c_float)>,
pub setPhase: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, phase: c_float)>,
pub setCenter: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, center: c_float)>,
pub setDepth: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, depth: c_float)>,
pub setArpeggiation: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, nSteps: c_int, steps: *mut c_float)>,
pub setFunction: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, lfoFunc: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, userdata: *mut c_void) -> c_float>, userdata: *mut c_void, interpolate: c_int)>,
pub setDelay: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, holdoff: c_float, ramptime: c_float)>,
pub setRetrigger: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, flag: c_int)>,
pub getValue: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO) -> c_float>,
pub setGlobal: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, global: c_int)>,
pub setStartPhase: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, phase: c_float)>,
}
Fields§
§newLFO: Option<unsafe extern "C" fn(type_: LFOType) -> *mut PDSynthLFO>
PDSynthLFO* playdate->sound->lfo->newLFO(LFOType type)
Returns a new LFO object, which can be used to modulate sounds. The type argument is one of the following values:
LFOType
typedef enum
{
kLFOTypeSquare,
kLFOTypeTriangle,
kLFOTypeSine,
kLFOTypeSampleAndHold,
kLFOTypeSawtoothUp,
kLFOTypeSawtoothDown,
kLFOTypeArpeggiator,
kLFOTypeFunction
} LFOType;
freeLFO: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO)>
void playdate->sound->lfo->freeLFO(PDSynthLFO* lfo)
Frees the LFO.
setType: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, type_: LFOType)>
void playdate->sound->lfo->setType(PDSynthLFO* lfo, LFOType type)
Sets the LFO shape to one of the values given above.
setRate: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, rate: c_float)>
void playdate->sound->lfo->setRate(PDSynthLFO* lfo, float rate)
Sets the LFO’s rate, in cycles per second.
setPhase: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, phase: c_float)>
void playdate->sound->lfo->setPhase(PDSynthLFO* lfo, float phase)
Sets the LFO’s phase, from 0 to 1.
setCenter: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, center: c_float)>
void playdate->sound->lfo->setCenter(PDSynthLFO* lfo, float center)
Sets the center value for the LFO.
setDepth: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, depth: c_float)>
void playdate->sound->lfo->setDepth(PDSynthLFO* lfo, float depth)
Sets the depth of the LFO.
setArpeggiation: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, nSteps: c_int, steps: *mut c_float)>
void playdate->sound->lfo->setArpeggiation(PDSynthLFO* lfo, int nSteps, float* steps)
Sets the LFO type to arpeggio, where the given values are in half-steps from the center note. For example, the sequence (0, 4, 7, 12) plays the notes of a major chord.
setFunction: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, lfoFunc: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, userdata: *mut c_void) -> c_float>, userdata: *mut c_void, interpolate: c_int)>
void playdate->sound->lfo->setFunction(PDSynthLFO* lfo, float (*lfoFunc)(PDSynthLFO* lfo, void* userdata), void* userdata, int interpolate)
Provides a custom function for LFO values.
setDelay: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, holdoff: c_float, ramptime: c_float)>
void playdate->sound->lfo->setDelay(PDSynthLFO* lfo, float holdoff, float ramptime)
Sets an initial holdoff time for the LFO where the LFO remains at its center value, and a ramp time where the value increases linearly to its maximum depth. Values are in seconds.
setRetrigger: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, flag: c_int)>
void playdate->sound->lfo->setRetrigger(PDSynthLFO* lfo, int flag)
If retrigger is on, the LFO’s phase is reset to its initial phase (default 0) when a synth using the LFO starts playing a note.
getValue: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO) -> c_float>
float playdate->sound->lfo->getValue(PDSynthLFO* lfo)
Return the current output value of the LFO.
setGlobal: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, global: c_int)>
void playdate->sound->lfo->setGlobal(PDSynthLFO* lfo, int global)
If global is set, the LFO is continuously updated whether or not it’s currently in use.
setStartPhase: Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, phase: c_float)>
void playdate->sound->lfo->setStartPhase(PDSynthLFO* lfo, float phase)
Sets the LFO’s initial phase, from 0 to 1.
Trait Implementations§
source§impl Clone for playdate_sound_lfo
impl Clone for playdate_sound_lfo
source§fn clone(&self) -> playdate_sound_lfo
fn clone(&self) -> playdate_sound_lfo
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_lfo
impl Debug for playdate_sound_lfo
source§impl Default for playdate_sound_lfo
impl Default for playdate_sound_lfo
source§fn default() -> playdate_sound_lfo
fn default() -> playdate_sound_lfo
source§impl Hash for playdate_sound_lfo
impl Hash for playdate_sound_lfo
source§impl Ord for playdate_sound_lfo
impl Ord for playdate_sound_lfo
source§impl PartialEq for playdate_sound_lfo
impl PartialEq for playdate_sound_lfo
source§fn eq(&self, other: &playdate_sound_lfo) -> bool
fn eq(&self, other: &playdate_sound_lfo) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for playdate_sound_lfo
impl PartialOrd for playdate_sound_lfo
impl Copy for playdate_sound_lfo
impl Eq for playdate_sound_lfo
impl StructuralPartialEq for playdate_sound_lfo
Auto Trait Implementations§
impl Freeze for playdate_sound_lfo
impl RefUnwindSafe for playdate_sound_lfo
impl Send for playdate_sound_lfo
impl Sync for playdate_sound_lfo
impl Unpin for playdate_sound_lfo
impl UnwindSafe for playdate_sound_lfo
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, 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: 56 bytes