Struct playdate_sound_sequence

Source
#[repr(C)]
pub struct playdate_sound_sequence {
Show 20 fields pub newSequence: Option<unsafe extern "C" fn() -> *mut SoundSequence>, pub freeSequence: Option<unsafe extern "C" fn(sequence: *mut SoundSequence)>, pub loadMIDIFile: Option<unsafe extern "C" fn(seq: *mut SoundSequence, path: *const c_char) -> c_int>, pub getTime: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>, pub setTime: Option<unsafe extern "C" fn(seq: *mut SoundSequence, time: u32)>, pub setLoops: Option<unsafe extern "C" fn(seq: *mut SoundSequence, loopstart: c_int, loopend: c_int, loops: c_int)>, pub getTempo_deprecated: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_int>, pub setTempo: Option<unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: c_float)>, pub getTrackCount: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_int>, pub addTrack: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> *mut SequenceTrack>, pub getTrackAtIndex: Option<unsafe extern "C" fn(seq: *mut SoundSequence, track: c_uint) -> *mut SequenceTrack>, pub setTrackAtIndex: Option<unsafe extern "C" fn(seq: *mut SoundSequence, track: *mut SequenceTrack, idx: c_uint)>, pub allNotesOff: Option<unsafe extern "C" fn(seq: *mut SoundSequence)>, pub isPlaying: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_int>, pub getLength: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>, pub play: Option<unsafe extern "C" fn(seq: *mut SoundSequence, finishCallback: SequenceFinishedCallback, userdata: *mut c_void)>, pub stop: Option<unsafe extern "C" fn(seq: *mut SoundSequence)>, pub getCurrentStep: Option<unsafe extern "C" fn(seq: *mut SoundSequence, timeOffset: *mut c_int) -> c_int>, pub setCurrentStep: Option<unsafe extern "C" fn(seq: *mut SoundSequence, step: c_int, timeOffset: c_int, playNotes: c_int)>, pub getTempo: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_float>,
}

Fields§

§newSequence: Option<unsafe extern "C" fn() -> *mut SoundSequence>

SoundSequence* playdate->sound->sequence->newSequence(void)

§freeSequence: Option<unsafe extern "C" fn(sequence: *mut SoundSequence)>

void playdate->sound->sequence->freeSequence(SoundSequence* sequence)

Creates or destroys a SoundSequence object.

§loadMIDIFile: Option<unsafe extern "C" fn(seq: *mut SoundSequence, path: *const c_char) -> c_int>

int playdate->sound->sequence->loadMIDIFile(SoundSequence* sequence, const char* path)

If the sequence is empty, attempts to load data from the MIDI file at path into the sequence. Returns 1 on success, 0 on failure.

§getTime: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>

uint32_t playdate->sound->sequence->getTime(SoundSequence* sequence)

§setTime: Option<unsafe extern "C" fn(seq: *mut SoundSequence, time: u32)>

void playdate->sound->sequence->setTime(SoundSequence* sequence, uint32_t time)

Gets or sets the current time in the sequence, in samples since the start of the file. Note that which step this moves the sequence to depends on the current tempo.

§setLoops: Option<unsafe extern "C" fn(seq: *mut SoundSequence, loopstart: c_int, loopend: c_int, loops: c_int)>

void playdate->sound->sequence->setLoops(SoundSequence* sequence, int startstep, int endstep, int loops)

Sets the looping range of the sequence. If loops is 0, the loop repeats endlessly.

§getTempo_deprecated: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_int>§setTempo: Option<unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: c_float)>

void playdate->sound->sequence->setTempo(SoundSequence* sequence, float stepsPerSecond)

Sets or gets the tempo of the sequence, in steps per second.

§getTrackCount: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_int>

int playdate->sound->sequence->getTrackCount(SoundSequence* sequence)

Returns the number of tracks in the sequence.

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

SequenceTrack* playdate->sound->sequence->addTrack(SoundSequence* sequence)

Adds the given playdate.sound.track to the sequence.

§getTrackAtIndex: Option<unsafe extern "C" fn(seq: *mut SoundSequence, track: c_uint) -> *mut SequenceTrack>

SequenceTrack* playdate->sound->sequence->getTrackAtIndex(SoundSequence* sequence, unsigned int idx)

§setTrackAtIndex: Option<unsafe extern "C" fn(seq: *mut SoundSequence, track: *mut SequenceTrack, idx: c_uint)>

void playdate->sound->sequence->setTrackAtIndex(SoundSequence* sequence, SequenceTrack* track, unsigned int idx)

Sets or gets the given SoundTrack object at position idx in the sequence.

§allNotesOff: Option<unsafe extern "C" fn(seq: *mut SoundSequence)>

void playdate->sound->sequence->allNotesOff(SoundSequence* sequence)

Sends a stop signal to all playing notes on all tracks.

§isPlaying: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_int>

int playdate->sound->sequence->isPlaying(SoundSequence* sequence)

Returns 1 if the sequence is currently playing, otherwise 0.

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

int playdate->sound->sequence->getLength(SoundSequence* sequence)

Returns the length of the longest track in the sequence, in steps. See also playdate.sound.track.getLength().

§play: Option<unsafe extern "C" fn(seq: *mut SoundSequence, finishCallback: SequenceFinishedCallback, userdata: *mut c_void)>

void playdate->sound->sequence->play(SoundSequence* sequence, SequenceFinishedCallback finishCallback, void* userdata)

§stop: Option<unsafe extern "C" fn(seq: *mut SoundSequence)>

void playdate->sound->sequence->stop(SoundSequence* sequence)

Starts or stops playing the sequence. finishCallback is an optional function to be called when the sequence finishes playing or is stopped.

SequenceFinishedCallback

typedef void (*SequenceFinishedCallback)(SoundSequence* seq, void* userdata);
§getCurrentStep: Option<unsafe extern "C" fn(seq: *mut SoundSequence, timeOffset: *mut c_int) -> c_int>

int playdate->sound->sequence->getCurrentStep(SoundSequence* sequence, int* timeOffset)

Returns the step number the sequence is currently at. If timeOffset is not NULL, its contents are set to the current sample offset within the step.

§setCurrentStep: Option<unsafe extern "C" fn(seq: *mut SoundSequence, step: c_int, timeOffset: c_int, playNotes: c_int)>

void playdate->sound->sequence->setCurrentStep(SoundSequence* seq, int step, int timeOffset, int playNotes)

Set the current step for the sequence. timeOffset is a sample offset within the step. If playNotes is set, notes at the given step (ignoring timeOffset) are played.

§getTempo: Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> c_float>

float playdate->sound->sequence->getTempo(SoundSequence* sequence)

Trait Implementations§

Source§

impl Clone for playdate_sound_sequence

Source§

fn clone(&self) -> playdate_sound_sequence

Returns a duplicate 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_sequence

Source§

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

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

impl Default for playdate_sound_sequence

Source§

fn default() -> playdate_sound_sequence

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

impl Hash for playdate_sound_sequence

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_sequence

Source§

fn cmp(&self, other: &playdate_sound_sequence) -> 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,

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

impl PartialEq for playdate_sound_sequence

Source§

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

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

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for playdate_sound_sequence

Source§

fn partial_cmp(&self, other: &playdate_sound_sequence) -> 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

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

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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for playdate_sound_sequence

Source§

impl Eq for playdate_sound_sequence

Source§

impl StructuralPartialEq for playdate_sound_sequence

Auto Trait Implementations§

§

impl Freeze for playdate_sound_sequence

§

impl RefUnwindSafe for playdate_sound_sequence

§

impl Send for playdate_sound_sequence

§

impl Sync for playdate_sound_sequence

§

impl Unpin for playdate_sound_sequence

§

impl UnwindSafe for playdate_sound_sequence

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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: 80 bytes