Struct playdate_sys::ffi::playdate_sound_track

source ·
#[repr(C)]
pub struct playdate_sound_track {
Show 17 fields pub newTrack: Option<unsafe extern "C" fn() -> *mut SequenceTrack>, pub freeTrack: Option<unsafe extern "C" fn(track: *mut SequenceTrack)>, pub setInstrument: Option<unsafe extern "C" fn(track: *mut SequenceTrack, inst: *mut PDSynthInstrument)>, pub getInstrument: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> *mut PDSynthInstrument>, pub addNoteEvent: Option<unsafe extern "C" fn(track: *mut SequenceTrack, step: u32, len: u32, note: MIDINote, velocity: c_float)>, pub removeNoteEvent: Option<unsafe extern "C" fn(track: *mut SequenceTrack, step: u32, note: MIDINote)>, pub clearNotes: Option<unsafe extern "C" fn(track: *mut SequenceTrack)>, pub getControlSignalCount: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> c_int>, pub getControlSignal: Option<unsafe extern "C" fn(track: *mut SequenceTrack, idx: c_int) -> *mut ControlSignal>, pub clearControlEvents: Option<unsafe extern "C" fn(track: *mut SequenceTrack)>, pub getPolyphony: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> c_int>, pub activeVoiceCount: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> c_int>, pub setMuted: Option<unsafe extern "C" fn(track: *mut SequenceTrack, mute: c_int)>, pub getLength: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> u32>, pub getIndexForStep: Option<unsafe extern "C" fn(track: *mut SequenceTrack, step: u32) -> c_int>, pub getNoteAtIndex: Option<unsafe extern "C" fn(track: *mut SequenceTrack, index: c_int, outStep: *mut u32, outLen: *mut u32, outNote: *mut MIDINote, outVelocity: *mut c_float) -> c_int>, pub getSignalForController: Option<unsafe extern "C" fn(track: *mut SequenceTrack, controller: c_int, create: c_int) -> *mut ControlSignal>,
}

Fields§

§newTrack: Option<unsafe extern "C" fn() -> *mut SequenceTrack>

SequenceTrack* playdate->sound->track->newTrack(void)

Returns a new SequenceTrack.

§freeTrack: Option<unsafe extern "C" fn(track: *mut SequenceTrack)>

void playdate->sound->track->freeTrack(SequenceTrack* track)

Frees the SequenceTrack.

§setInstrument: Option<unsafe extern "C" fn(track: *mut SequenceTrack, inst: *mut PDSynthInstrument)>

void playdate->sound->track->setInstrument(SequenceTrack* track, PDSynthInstrument* instrument)

§getInstrument: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> *mut PDSynthInstrument>

PDSynthInstrument* playdate->sound->track->getInstrument(SequenceTrack* track)

Sets or gets the PDSynthInstrument assigned to the track.

§addNoteEvent: Option<unsafe extern "C" fn(track: *mut SequenceTrack, step: u32, len: u32, note: MIDINote, velocity: c_float)>

void playdate->sound->track->addNoteEvent(SequenceTrack* track, uint32_t step, uint32_t length, MIDINote note, float vel)

Adds a single note event to the track.

§removeNoteEvent: Option<unsafe extern "C" fn(track: *mut SequenceTrack, step: u32, note: MIDINote)>

void playdate->sound->track->removeNoteEvent(SequenceTrack* track, uint32_t step, MIDINote note)

Removes the event at step playing note.

§clearNotes: Option<unsafe extern "C" fn(track: *mut SequenceTrack)>

void playdate->sound->track->clearNotes(SequenceTrack* track)

Clears all notes from the track.

§getControlSignalCount: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> c_int>

void playdate->sound->track->getControlSignalCount(SequenceTrack* track)

Returns the number of ControlSignal objects in the track.

§getControlSignal: Option<unsafe extern "C" fn(track: *mut SequenceTrack, idx: c_int) -> *mut ControlSignal>

void playdate->sound->track->getControlSignal(SequenceTrack* track, int idx)

Returns the ControlSignal at index idx.

§clearControlEvents: Option<unsafe extern "C" fn(track: *mut SequenceTrack)>

void playdate->sound->track->clearControlEvents(SequenceTrack* track)

Clears all ControlSignals from the track.

§getPolyphony: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> c_int>

int playdate->sound->track->getPolyphony(SequenceTrack* track)

Returns the maximum number of simultaneously playing notes in the track. (Currently, this value is only set when the track was loaded from a MIDI file. We don’t yet track polyphony for user-created events.)

§activeVoiceCount: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> c_int>

int playdate->sound->track->activeVoiceCount(SequenceTrack* track)

Returns the number of voices currently playing in the track’s instrument.

§setMuted: Option<unsafe extern "C" fn(track: *mut SequenceTrack, mute: c_int)>

void playdate->sound->track->setMuted(SequenceTrack* track, int mute)

Mutes or unmutes the track.

§getLength: Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> u32>

int playdate->sound->track->getLength(SequenceTrack* track)

Returns the length, in steps, of the track—​that is, the step where the last note in the track ends.

§getIndexForStep: Option<unsafe extern "C" fn(track: *mut SequenceTrack, step: u32) -> c_int>

int playdate->sound->track->getIndexForStep(SequenceTrack* track, uint32_t step)

Returns the internal array index for the first note at the given step.

§getNoteAtIndex: Option<unsafe extern "C" fn(track: *mut SequenceTrack, index: c_int, outStep: *mut u32, outLen: *mut u32, outNote: *mut MIDINote, outVelocity: *mut c_float) -> c_int>

int playdate->sound->track->getNoteAtIndex(SequenceTrack* track, int index, uint32_t* outStep, uint32_t* outLen, MIDINote* outNote, float* outVelocity)

If the given index is in range, sets the data in the out pointers and returns 1; otherwise, returns 0.

§getSignalForController: Option<unsafe extern "C" fn(track: *mut SequenceTrack, controller: c_int, create: c_int) -> *mut ControlSignal>

void playdate->sound->track->getSignalForController(SequenceTrack* track, int controller, int create)

Returns the ControlSignal for MIDI controller number controller, creating it if the create flag is set and it doesn’t yet exist.

Trait Implementations§

source§

impl Clone for playdate_sound_track

source§

fn clone(&self) -> playdate_sound_track

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for playdate_sound_track

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for playdate_sound_track

source§

fn default() -> playdate_sound_track

Returns the “default value” for a type. Read more
source§

impl Hash for playdate_sound_track

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for playdate_sound_track

source§

fn cmp(&self, other: &playdate_sound_track) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for playdate_sound_track

source§

fn eq(&self, other: &playdate_sound_track) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for playdate_sound_track

source§

fn partial_cmp(&self, other: &playdate_sound_track) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for playdate_sound_track

source§

impl Eq for playdate_sound_track

source§

impl StructuralPartialEq for playdate_sound_track

Auto Trait Implementations§

§

impl Freeze for playdate_sound_track

§

impl RefUnwindSafe for playdate_sound_track

§

impl Send for playdate_sound_track

§

impl Sync for playdate_sound_track

§

impl Unpin for playdate_sound_track

§

impl UnwindSafe for playdate_sound_track

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

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: 68 bytes