#[repr(C)]pub struct playdate_sound_fileplayer {Show 22 fields
pub newPlayer: Option<unsafe extern "C" fn() -> *mut FilePlayer>,
pub freePlayer: Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
pub loadIntoPlayer: Option<unsafe extern "C" fn(player: *mut FilePlayer, path: *const c_char) -> c_int>,
pub setBufferLength: Option<unsafe extern "C" fn(player: *mut FilePlayer, bufferLen: c_float)>,
pub play: Option<unsafe extern "C" fn(player: *mut FilePlayer, repeat: c_int) -> c_int>,
pub isPlaying: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_int>,
pub pause: Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
pub stop: Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
pub setVolume: Option<unsafe extern "C" fn(player: *mut FilePlayer, left: c_float, right: c_float)>,
pub getVolume: Option<unsafe extern "C" fn(player: *mut FilePlayer, left: *mut c_float, right: *mut c_float)>,
pub getLength: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_float>,
pub setOffset: Option<unsafe extern "C" fn(player: *mut FilePlayer, offset: c_float)>,
pub setRate: Option<unsafe extern "C" fn(player: *mut FilePlayer, rate: c_float)>,
pub setLoopRange: Option<unsafe extern "C" fn(player: *mut FilePlayer, start: c_float, end: c_float)>,
pub didUnderrun: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_int>,
pub setFinishCallback: Option<unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc, userdata: *mut c_void)>,
pub setLoopCallback: Option<unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc, userdata: *mut c_void)>,
pub getOffset: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_float>,
pub getRate: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_float>,
pub setStopOnUnderrun: Option<unsafe extern "C" fn(player: *mut FilePlayer, flag: c_int)>,
pub fadeVolume: Option<unsafe extern "C" fn(player: *mut FilePlayer, left: c_float, right: c_float, len: i32, finishCallback: sndCallbackProc, userdata: *mut c_void)>,
pub setMP3StreamSource: Option<unsafe extern "C" fn(player: *mut FilePlayer, dataSource: Option<unsafe extern "C" fn(data: *mut u8, bytes: c_int, userdata: *mut c_void) -> c_int>, userdata: *mut c_void, bufferLen: c_float)>,
}Fields§
§newPlayer: Option<unsafe extern "C" fn() -> *mut FilePlayer>FilePlayer* playdate->sound->fileplayer->newPlayer(void);
Allocates a new FilePlayer.
freePlayer: Option<unsafe extern "C" fn(player: *mut FilePlayer)>void playdate->sound->fileplayer->freePlayer(FilePlayer* player);
Frees the given player.
loadIntoPlayer: Option<unsafe extern "C" fn(player: *mut FilePlayer, path: *const c_char) -> c_int>int playdate->sound->fileplayer->loadIntoPlayer(FilePlayer* player, const char* path);
Prepares player to stream the file at path. Returns 1 if the file exists, otherwise 0.
setBufferLength: Option<unsafe extern "C" fn(player: *mut FilePlayer, bufferLen: c_float)>void playdate->sound->fileplayer->setBufferLength(FilePlayer* player, float bufferLen);
Sets the buffer length of player to bufferLen seconds;
play: Option<unsafe extern "C" fn(player: *mut FilePlayer, repeat: c_int) -> c_int>int playdate->sound->fileplayer->play(FilePlayer* player, int repeat);
Starts playing the file player. If repeat is greater than one, it loops the given number of times. If zero, it loops endlessly until it is stopped with playdate->sound->fileplayer->stop(). Returns 1 on success, 0 if buffer allocation failed.
isPlaying: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_int>int playdate->sound->fileplayer->isPlaying(FilePlayer* player);
Returns one if player is playing, zero if not.
pause: Option<unsafe extern "C" fn(player: *mut FilePlayer)>void playdate->sound->fileplayer->pause(FilePlayer* player);
Pauses the file player.
stop: Option<unsafe extern "C" fn(player: *mut FilePlayer)>void playdate->sound->fileplayer->stop(FilePlayer* player);
Stops playing the file.
setVolume: Option<unsafe extern "C" fn(player: *mut FilePlayer, left: c_float, right: c_float)>void playdate->sound->fileplayer->setVolume(FilePlayer* player, float left, float right);
Sets the playback volume for left and right channels of player.
getVolume: Option<unsafe extern "C" fn(player: *mut FilePlayer, left: *mut c_float, right: *mut c_float)>void playdate->sound->fileplayer->getVolume(FilePlayer* player, float* outleft, float* outright);
Gets the left and right channel playback volume for player.
getLength: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_float>float playdate->sound->fileplayer->getLength(FilePlayer* player);
Returns the length, in seconds, of the file loaded into player.
setOffset: Option<unsafe extern "C" fn(player: *mut FilePlayer, offset: c_float)>void playdate->sound->fileplayer->setOffset(FilePlayer* player, float offset);
Sets the current offset in seconds.
setRate: Option<unsafe extern "C" fn(player: *mut FilePlayer, rate: c_float)>void playdate->sound->fileplayer->setRate(FilePlayer* player, float rate)
Sets the playback rate for the player. 1.0 is normal speed, 0.5 is down an octave, 2.0 is up an octave, etc. Unlike sampleplayers, fileplayers can’t play in reverse (i.e., rate < 0).
setLoopRange: Option<unsafe extern "C" fn(player: *mut FilePlayer, start: c_float, end: c_float)>void playdate->sound->fileplayer->setLoopRange(FilePlayer* player, float start, float end);
Sets the start and end of the loop region for playback, in seconds. If end is omitted, the end of the file is used.
didUnderrun: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_int>int playdate->sound->fileplayer->didUnderrun(FilePlayer* player);
Returns one if player has underrun, zero if not.
setFinishCallback: Option<unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc, userdata: *mut c_void)>void playdate->sound->fileplayer->setFinishCallback(FilePlayer* player, sndCallbackProc callback, void* userdata);
Sets a function to be called when playback has completed. This is an alias for playdate→sound→source→setFinishCallback().
sndCallbackProc
typedef void sndCallbackProc(SoundSource* c, void* userdata);setLoopCallback: Option<unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc, userdata: *mut c_void)>§getOffset: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_float>float playdate->sound->fileplayer->getOffset(FilePlayer* player);
Returns the current offset in seconds for player.
getRate: Option<unsafe extern "C" fn(player: *mut FilePlayer) -> c_float>float playdate->sound->fileplayer->getRate(FilePlayer* player)
Returns the playback rate for player.
setStopOnUnderrun: Option<unsafe extern "C" fn(player: *mut FilePlayer, flag: c_int)>void playdate->sound->fileplayer->setStopOnUnderrun(FilePlayer* player, int flag)
If flag evaluates to true, the player will restart playback (after an audible stutter) as soon as data is available.
fadeVolume: Option<unsafe extern "C" fn(player: *mut FilePlayer, left: c_float, right: c_float, len: i32, finishCallback: sndCallbackProc, userdata: *mut c_void)>void playdate->sound->fileplayer->fadeVolume(FilePlayer* player, float left, float right, int32_t len, sndCallbackProc finishCallback, void* userdata);
Changes the volume of the fileplayer to left and right over a length of len sample frames, then calls the provided callback (if set).
setMP3StreamSource: Option<unsafe extern "C" fn(player: *mut FilePlayer, dataSource: Option<unsafe extern "C" fn(data: *mut u8, bytes: c_int, userdata: *mut c_void) -> c_int>, userdata: *mut c_void, bufferLen: c_float)>Trait Implementations§
Source§impl Clone for playdate_sound_fileplayer
impl Clone for playdate_sound_fileplayer
Source§fn clone(&self) -> playdate_sound_fileplayer
fn clone(&self) -> playdate_sound_fileplayer
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_fileplayer
impl Debug for playdate_sound_fileplayer
Source§impl Default for playdate_sound_fileplayer
impl Default for playdate_sound_fileplayer
Source§fn default() -> playdate_sound_fileplayer
fn default() -> playdate_sound_fileplayer
Source§impl Hash for playdate_sound_fileplayer
impl Hash for playdate_sound_fileplayer
Source§impl Ord for playdate_sound_fileplayer
impl Ord for playdate_sound_fileplayer
Source§impl PartialEq for playdate_sound_fileplayer
impl PartialEq for playdate_sound_fileplayer
Source§impl PartialOrd for playdate_sound_fileplayer
impl PartialOrd for playdate_sound_fileplayer
Source§fn partial_cmp(&self, other: &playdate_sound_fileplayer) -> Option<Ordering>
fn partial_cmp(&self, other: &playdate_sound_fileplayer) -> Option<Ordering>
impl Copy for playdate_sound_fileplayer
impl Eq for playdate_sound_fileplayer
impl StructuralPartialEq for playdate_sound_fileplayer
Auto Trait Implementations§
impl Freeze for playdate_sound_fileplayer
impl RefUnwindSafe for playdate_sound_fileplayer
impl Send for playdate_sound_fileplayer
impl Sync for playdate_sound_fileplayer
impl Unpin for playdate_sound_fileplayer
impl UnwindSafe for playdate_sound_fileplayer
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: 88 bytes