Struct Source

Source
pub struct Source { /* private fields */ }
Expand description

A source used to play Buffers. NOTE: Sources are bound to a context.

Implementations§

Source§

impl Source

Source

pub fn pitch(&self) -> f32

Source

pub fn set_pitch(&self, value: f32)

Source

pub fn gain(&self) -> f32

Source

pub fn set_gain(&self, value: f32)

Source

pub fn min_gain(&self) -> f32

Source

pub fn set_min_gain(&self, value: f32)

Source

pub fn max_gain(&self) -> f32

Source

pub fn set_max_gain(&self, value: f32)

Source

pub fn max_distance(&self) -> f32

Source

pub fn set_max_distance(&self, value: f32)

Source

pub fn rolloff_factor(&self) -> f32

Source

pub fn set_rolloff_factor(&self, value: f32)

Source

pub fn reference_distance(&self) -> f32

Source

pub fn set_reference_distance(&self, value: f32)

Source

pub fn cone_outer_gain(&self) -> f32

Source

pub fn set_cone_outer_gain(&self, value: f32)

Source

pub fn cone_inner_angle(&self) -> f32

Source

pub fn set_cone_inner_angle(&self, value: f32)

Source

pub fn cone_outer_angle(&self) -> f32

Source

pub fn set_cone_outer_angle(&self, value: f32)

Source

pub fn time_in_secs(&self) -> f32

Source

pub fn set_time_in_secs(&self, value: f32)

Source

pub fn time_in_samples(&self) -> i32

Source

pub fn set_time_in_samples(&self, value: i32)

Source

pub fn time_in_bytes(&self) -> i32

Source

pub fn set_time_in_bytes(&self, value: i32)

Source

pub fn position(&self) -> [f32; 3]

Source

pub fn set_position(&self, value: [f32; 3])

Source

pub fn velocity(&self) -> [f32; 3]

Source

pub fn set_velocity(&self, value: [f32; 3])

Source

pub fn direction(&self) -> [f32; 3]

Source

pub fn set_direction(&self, value: [f32; 3])

Source

pub fn is_looping(&self) -> bool

Source

pub fn set_looping(&self, value: bool)

Source

pub fn is_relative(&self) -> bool

Source

pub fn set_relative(&self, value: bool)

Source

pub fn state(&self) -> SourceState

Source

pub fn set_state(&self, value: SourceState)

Source

pub fn set_buffer(&self, buffer: Option<&Buffer>)

Source

pub fn buffers_queued(&self) -> i32

Source

pub fn buffers_processed(&self) -> i32

Source§

impl Source

Source

pub fn play(&self) -> Result<(), AllenError>

Source

pub fn pause(&self) -> Result<(), AllenError>

Source

pub fn stop(&self) -> Result<(), AllenError>

Source

pub fn rewind(&self) -> Result<(), AllenError>

Source

pub fn queue_buffers(&self, buffers: &[&Buffer]) -> Result<(), AllenError>

Source

pub fn queue_buffer(&self, buffer: &Buffer) -> Result<(), AllenError>

Source

pub fn unqueue_buffers(&self, count: i32) -> Result<(), AllenError>

Trait Implementations§

Source§

impl Drop for Source

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Source

§

impl RefUnwindSafe for Source

§

impl !Send for Source

§

impl !Sync for Source

§

impl Unpin for Source

§

impl UnwindSafe for Source

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