Struct cubeb_core::Stream

source ·
pub struct Stream(/* private fields */);

Implementations§

source§

impl Stream

source

pub unsafe fn from_ptr(ptr: *mut cubeb_stream) -> Stream

Safety

This function is unsafe because it dereferences the given ptr pointer. The caller should ensure that pointer is valid.

source

pub fn as_ptr(&self) -> *mut cubeb_stream

Methods from Deref<Target = StreamRef>§

source

pub fn as_ptr(&self) -> *mut cubeb_stream

source

pub fn start(&self) -> Result<()>

Start playback.

source

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

Stop playback.

source

pub fn position(&self) -> Result<u64>

Get the current stream playback position.

source

pub fn latency(&self) -> Result<u32>

Get the latency for this stream, in frames. This is the number of frames between the time cubeb acquires the data in the callback and the listener can hear the sound.

source

pub fn input_latency(&self) -> Result<u32>

Get the input latency for this stream, in frames. This is the number of frames between the time the audio input device records the audio, and the cubeb callback delivers it. This returns an error if the stream is output-only.

source

pub fn set_volume(&self, volume: f32) -> Result<()>

Set the volume for a stream.

source

pub fn set_name(&self, name: &CStr) -> Result<()>

Change a stream’s name

source

pub fn current_device(&self) -> Result<&DeviceRef>

Get the current output device for this stream.

source

pub fn set_input_mute(&self, mute: bool) -> Result<()>

Set the mute state for an input stream.

source

pub fn set_input_processing_params( &self, params: InputProcessingParams ) -> Result<()>

Set the processing parameters for an input stream.

source

pub fn device_destroy(&self, device: DeviceRef) -> Result<()>

Destroy a cubeb_device structure.

source

pub fn register_device_changed_callback( &self, callback: cubeb_device_changed_callback ) -> Result<()>

Set a callback to be notified when the output device changes.

source

pub fn user_ptr(&self) -> *mut c_void

Trait Implementations§

source§

impl AsRef<StreamRef> for Stream

source§

fn as_ref(&self) -> &StreamRef

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

impl Borrow<StreamRef> for Stream

source§

fn borrow(&self) -> &StreamRef

Immutably borrows from an owned value. Read more
source§

impl Deref for Stream

§

type Target = StreamRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &StreamRef

Dereferences the value.
source§

impl DerefMut for Stream

source§

fn deref_mut(&mut self) -> &mut StreamRef

Mutably dereferences the value.
source§

impl Drop for Stream

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Stream

§

impl !Send for Stream

§

impl !Sync for Stream

§

impl Unpin for Stream

§

impl UnwindSafe for Stream

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

§

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.