SoundSource

Struct SoundSource 

Source
pub struct SoundSource<Api = Default>(/* private fields */);

Implementations§

Source§

impl<Api: Api> SoundSource<Api>

Source

pub fn from_with(api: Api, ptr: *mut OpaqueSoundSource) -> Self

Source

pub fn is_playing(&self) -> bool

Returns true if the source is currently playing.

Equivalent to sys::ffi::playdate_sound_source::isPlaying

Source

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

Source

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

Source

pub fn set_finish_callback_raw(&self, callback: sndCallbackProc)

Trait Implementations§

Source§

impl<Api> AsRaw for SoundSource<Api>

Source§

type Type = SoundSource

Source§

unsafe fn as_raw(&self) -> *mut Self::Type

This method ia actually safe. Unsafety is because so we’re removing owners lifetime that used by some API parts.
Source§

impl<Api: Debug> Debug for SoundSource<Api>

Source§

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

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

impl<Api: Default> From<*mut SoundSource> for SoundSource<Api>

Source§

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 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, 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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.