Struct rscenes::prelude::Music

#[repr(C)]
pub struct Music { pub stream: AudioStream, pub frameCount: u32, pub looping: bool, pub ctxType: i32, pub ctxData: *mut c_void, }

Fields§

§stream: AudioStream§frameCount: u32§looping: bool§ctxType: i32§ctxData: *mut c_void

Trait Implementations§

§

impl Clone for Music

§

fn clone(&self) -> Music

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Music

§

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

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

impl MusicExt for Music

source§

fn load(filename: impl Display) -> Result<Music, String>

Load music stream from file
source§

fn load_from_memory(tpe: impl Display, data: &[u8]) -> Result<Music, String>

Load music stream from data
source§

fn is_ready(self) -> bool

Check whether a music stream is ready
source§

fn unload(self)

Unload music stream
source§

fn play(self)

Start music playing
source§

fn is_playing(self) -> bool

Check whether music is playing
source§

fn update(self)

Updates buffers for music streaming
source§

fn stop(self)

Stop music playing
source§

fn pause(self)

Pause music playing
source§

fn resume(self)

Resume playing paused music
source§

fn seek(self, position: f32)

Seek music to a position (in seconds)
source§

fn set_volume(self, volume: f32)

Set volume for music (1.0 is max level)
source§

fn set_pitch(self, pitch: f32)

Set pitch for a music (1.0 is base level)
source§

fn set_pan(self, pan: f32)

Set pan for a music (0.5 is center)
source§

fn get_time_length(self) -> f32

Get music time length (in seconds)
source§

fn get_time_played(self) -> f32

Get current music time played (in seconds)
§

impl Copy for Music

Auto Trait Implementations§

§

impl RefUnwindSafe for Music

§

impl !Send for Music

§

impl !Sync for Music

§

impl Unpin for Music

§

impl UnwindSafe for Music

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.