Performer

Struct Performer 

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

A Cmajor performer.

Implementations§

Source§

impl Performer

Source

pub fn set_block_size(&mut self, num_frames: u32)

Sets the block size of the performer.

Source

pub fn advance(&mut self)

Renders the next block of frames.

Source

pub fn endpoint_info<T>(&self, Endpoint: Endpoint<T>) -> Option<&EndpointInfo>
where T: EndpointType,

Returns information about a given endpoint.

Source

pub fn set<T>( &mut self, endpoint: Endpoint<InputValue<T>>, value: T, ) -> T::Output
where T: SetInputValue,

Set the value of an endpoint.

Source

pub fn get<T>(&mut self, endpoint: Endpoint<OutputValue<T>>) -> T::Output<'_>
where T: GetOutputValue,

Get the value of an endpoint.

Source

pub fn post<'a>( &mut self, endpoint: Endpoint<InputEvent>, event: impl Into<ValueRef<'a>>, ) -> Result<(), EndpointError>

Post an event to an endpoint.

Source

pub fn fetch( &mut self, endpoint: Endpoint<OutputEvent>, callback: impl FnMut(usize, ValueRef<'_>), ) -> Result<(), EndpointError>

Fetch the events received from an endpoint.

Source

pub fn read<T>(&self, endpoint: Endpoint<OutputStream<T>>, buffer: &mut [T])
where T: StreamType,

Read frames from an input stream.

Source

pub fn write<T>(&self, endpoint: Endpoint<InputStream<T>>, buffer: &[T])
where T: StreamType,

Write frames to an output stream.

Source

pub fn get_xruns(&self) -> usize

Returns the number of times the performer has over/under-run.

Source

pub fn get_max_block_size(&self) -> u32

Returns the maximum number of frames that can be processed in a single call to advance.

Source

pub fn get_latency(&self) -> f64

Returns the performers internal latency in frames.

Source

pub fn get_string(&self, StringHandle: StringHandle) -> Option<&str>

Returns the string associated with a handle.

Auto Trait Implementations§

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.