Skip to main content

TalkbackControl

Struct TalkbackControl 

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

The control side of a talkback bus.

Implementations§

Source§

impl TalkbackControl

Source

pub fn add(&self, id: &str) -> Option<SpeakerInput>

Add a speaker (or return the one with this id). None when the bus is full.

Source

pub fn remove(&self, id: &str)

Remove a speaker (the audio side lets go of it at its next block).

Source

pub fn set_gain(&self, id: &str, gain: f32)

A speaker’s volume (linear, 0 to 4).

Source

pub fn set_muted(&self, id: &str, muted: bool)

Mute or unmute one speaker for yourself.

Source

pub fn set_all_muted(&self, muted: bool)

Mute all talkback for yourself. The music is never touched.

Source

pub fn active(&self) -> bool

Whether someone is audible now (for ducking).

Source

pub fn stats(&self) -> Vec<SpeakerStats>

Each speaker’s numbers.

Auto Trait Implementations§

§

impl !Freeze for TalkbackControl

§

impl Forget for TalkbackControl

§

impl Move for TalkbackControl

§

impl RefUnwindSafe for TalkbackControl

§

impl Send for TalkbackControl
where Arc<ArrayQueue<Arc<Speaker>>>: Send, Mutex<Vec<Arc<Speaker>>>: Send, Arc<Atomic<bool>>: Send,

§

impl Sync for TalkbackControl
where Arc<ArrayQueue<Arc<Speaker>>>: Sync, Mutex<Vec<Arc<Speaker>>>: Sync, Arc<Atomic<bool>>: Sync,

§

impl Unpin for TalkbackControl
where Arc<ArrayQueue<Arc<Speaker>>>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, *const u8 is !null: Unpin, Arc<Speaker>: Unpin, Arc<Atomic<bool>>: Unpin,

§

impl UnsafeUnpin for TalkbackControl
where *const ArcInner<ArrayQueue<Arc<Speaker>>> is !null: UnsafeUnpin, PhantomData<ArcInner<ArrayQueue<Arc<Speaker>>>>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Arc<Speaker>>: UnsafeUnpin, *const ArcInner<Atomic<bool>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,

§

impl UnwindSafe for TalkbackControl
where Arc<ArrayQueue<Arc<Speaker>>>: UnwindSafe, Mutex<Vec<Arc<Speaker>>>: UnwindSafe, Arc<Atomic<bool>>: UnwindSafe,

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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.