pub struct SoundSource<Api = Default>(/* private fields */);Implementations§
Source§impl<Api: Api> SoundSource<Api>
impl<Api: Api> SoundSource<Api>
pub fn from_with(api: Api, ptr: *mut OpaqueSoundSource) -> Self
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Returns true if the source is currently playing.
Equivalent to sys::ffi::playdate_sound_source::isPlaying
Sourcepub fn get_volume(&self) -> (c_float, c_float)
pub fn get_volume(&self) -> (c_float, c_float)
Gets the playback volume (0.0 - 1.0) for left and right channels of the source.
Equivalent to sys::ffi::playdate_sound_source::getVolume
Sourcepub fn set_volume(&self, left: c_float, right: c_float)
pub fn set_volume(&self, left: c_float, right: c_float)
Sets the playback volume (0.0 - 1.0) for left and right channels of the source.
Equivalent to sys::ffi::playdate_sound_source::setVolume
Sourcepub fn set_finish_callback_raw(&self, callback: sndCallbackProc)
pub fn set_finish_callback_raw(&self, callback: sndCallbackProc)
Equivalent to sys::ffi::playdate_sound_source::setFinishCallback
Trait Implementations§
Source§impl<Api> AsRaw for SoundSource<Api>
impl<Api> AsRaw for SoundSource<Api>
Source§impl<Api: Debug> Debug for SoundSource<Api>
impl<Api: Debug> Debug for SoundSource<Api>
Source§impl<Api: Default> From<*mut SoundSource> for SoundSource<Api>
impl<Api: Default> From<*mut SoundSource> for SoundSource<Api>
Source§fn from(ptr: *mut OpaqueSoundSource) -> Self
fn from(ptr: *mut OpaqueSoundSource) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<Api> Freeze for SoundSource<Api>where
Api: Freeze,
impl<Api> RefUnwindSafe for SoundSource<Api>where
Api: RefUnwindSafe,
impl<Api = Default> !Send for SoundSource<Api>
impl<Api = Default> !Sync for SoundSource<Api>
impl<Api> Unpin for SoundSource<Api>where
Api: Unpin,
impl<Api> UnwindSafe for SoundSource<Api>where
Api: UnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.