Skip to main content

Engine

Struct Engine 

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

The control half: send commands, read events and the clock. Cheap to share by reference between threads.

Implementations§

Source§

impl Engine

Source

pub fn send(&self, command: Command) -> Result<(), Command>

Queues a command for the next device block. Err gives the command back when the queue is full (512 deep).

Source

pub fn poll_event(&self) -> Option<Event>

The next event from the audio thread, if there is one.

Source

pub fn timing(&self) -> Timing

The latest clock reading.

Source

pub fn now_ns(&self) -> u64

Monotonic nanoseconds since the engine was made: the time base of Timing::callback_ns.

Source

pub fn config(&self) -> SinkConfig

Source

pub fn dropped_events(&self) -> u64

Events the audio thread had to drop because the event queue was full. Scene retirements are never dropped.

Source

pub fn dropped_dry_samples(&self) -> u64

Samples of the dry tap that were lost because nobody read them in time.

Source

pub fn read_dry(&self, out: &mut [f32]) -> usize

Reads up to out.len() interleaved samples of the dry bus. Returns how many it wrote. Zero if there is no tap.

Auto Trait Implementations§

§

impl Forget for Engine

§

impl Freeze for Engine
where *const ArcInner<Shared> is !null: Freeze, PhantomData<ArcInner<Shared>>: Freeze,

§

impl Move for Engine

§

impl RefUnwindSafe for Engine

§

impl Send for Engine
where Arc<Shared>: Send,

§

impl Sync for Engine
where Arc<Shared>: Sync,

§

impl Unpin for Engine
where Arc<Shared>: Unpin,

§

impl UnsafeUnpin for Engine
where *const ArcInner<Shared> is !null: UnsafeUnpin, PhantomData<ArcInner<Shared>>: UnsafeUnpin,

§

impl UnwindSafe for Engine
where Arc<Shared>: 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.