Skip to main content

ProcessContext

Struct ProcessContext 

Source
pub struct ProcessContext<'a> {
    pub sample_rate: f64,
    pub max_block_size: usize,
    pub transport: Option<TransportInfo>,
    pub output_events: &'a mut EventList,
}
Expand description

Per-block context carrying host state into process and returning per-block side-channel data from it.

Plugins write outbound events (MIDI thru, parameter touches) into output_events; the wrapper drains them after the call returns. Hosts that don’t care about outbound events pass an empty list and ignore whatever the plugin pushes.

Fields§

§sample_rate: f64

Sample rate active for this block. Plugins should recompute coefficients when this changes between blocks (rare but legal — host sample-rate change without a full deactivate / activate cycle).

§max_block_size: usize

Maximum frames the plugin was prepared for. The buffer’s num_frames() may be less; never more.

§transport: Option<TransportInfo>

Host transport snapshot for this block. None when the host doesn’t expose transport (most CLAP hosts via the optional clap.transport extension only on hosts that support it).

§output_events: &'a mut EventList

Outbound event sink the plugin pushes parameter touches / MIDI thru into. Cleared by the wrapper at the start of each block.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for ProcessContext<'a>

§

impl<'a> Freeze for ProcessContext<'a>

§

impl<'a> RefUnwindSafe for ProcessContext<'a>

§

impl<'a> Send for ProcessContext<'a>

§

impl<'a> Sync for ProcessContext<'a>

§

impl<'a> Unpin for ProcessContext<'a>

§

impl<'a> UnsafeUnpin for ProcessContext<'a>

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.