Struct Music

Source
pub struct Music<'a>(/* private fields */);

Implementations§

Source§

impl<'a> Music<'a>

Source

pub unsafe fn unwrap(self) -> Music

Take the raw ffi type. Must manually free memory by calling the proper unload function

Source§

impl<'aud> Music<'aud>

Source

pub fn play_stream(&self)

Starts music playing.

Source

pub fn update_stream(&self)

Updates buffers for music streaming.

Source

pub fn stop_stream(&self)

Stops music playing.

Source

pub fn pause_stream(&self)

Pauses music playing.

Source

pub fn resume_stream(&self)

Resumes playing paused music.

Source

pub fn is_stream_playing(&self) -> bool

Checks if music is playing.

Source

pub fn set_volume(&self, volume: f32)

Sets volume for music (1.0 is max level).

Source

pub fn set_pitch(&self, pitch: f32)

Sets pitch for music (1.0 is base level).

Source

pub fn get_time_length(&self) -> f32

Gets music time length in seconds.

Source

pub fn get_time_played(&self) -> f32

Gets current music time played in seconds.

Source

pub fn seek_stream(&self, position: f32)

Source

pub fn set_pan(&self, pan: f32)

Source

pub fn is_music_valid(&self) -> bool

Trait Implementations§

Source§

impl<'a> AsMut<Music> for Music<'a>

Source§

fn as_mut(&mut self) -> &mut Music

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<'a> AsRef<Music> for Music<'a>

Source§

fn as_ref(&self) -> &Music

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Debug for Music<'a>

Source§

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

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

impl<'a> Deref for Music<'a>

Source§

type Target = Music

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a> DerefMut for Music<'a>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'a> Drop for Music<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Music<'a>

§

impl<'a> RefUnwindSafe for Music<'a>

§

impl<'a> !Send for Music<'a>

§

impl<'a> !Sync for Music<'a>

§

impl<'a> Unpin for Music<'a>

§

impl<'a> UnwindSafe for Music<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.