Skip to main content

ChunkedProcess

Struct ChunkedProcess 

Source
pub struct ChunkedProcess<'a> {
    pub events: &'a EventList,
    pub sub_event_scratch: &'a mut EventList,
    pub transport: &'a mut TransportInfo,
    pub sample_rate: f64,
    pub output_events: &'a mut EventList,
    pub params_fn: Option<&'a dyn Fn(u32) -> f64>,
    pub meters_fn: Option<&'a dyn Fn(u32, f32)>,
    pub param_infos: &'a [ParamInfo],
    pub min_subblock_samples: u32,
}
Expand description

Inputs to process_chunked.

Bundled into a struct because the call has eight load-bearing references plus a couple of value fields and a positional argument list at that width is unreadable at the call site (every wrapper would invent its own helper). Construct one per process() call.

Fields§

§events: &'a EventList

Sorted, block-rate event stream from the host (param changes, transport changes, MIDI). The chunker walks this once forward; it does not mutate the list.

§sub_event_scratch: &'a mut EventList

Per-instance scratch list pre-allocated to the same capacity as events. Used to hold the per-sub-block rebased view of events; clear()-ed at the start of every sub-block so the backing Vec capacity is preserved across blocks. Wrappers hold this alongside their input / output event lists.

§transport: &'a mut TransportInfo

Initial transport snapshot for the block. Mutated in place as the chunker walks past EventBody::Transport events; the per-sub-block ProcessContext reads from this so the plugin sees the right tempo / position for the sub-block it’s in.

§sample_rate: f64

Host sample rate, plumbed through to each per-sub-block ProcessContext.

§output_events: &'a mut EventList

Plugin’s outbound event queue. The chunker re-bases outbound events back to block-relative coordinates before the wrapper hands them to the host: the plugin pushes events with sub-block-relative offsets, the chunker shifts them by the sub-block’s start sample.

§params_fn: Option<&'a dyn Fn(u32) -> f64>

Optional read-side params closure plumbed through to each per-sub-block ProcessContext. Same shape as ProcessContext::with_params.

§meters_fn: Option<&'a dyn Fn(u32, f32)>

Optional meter-write closure plumbed through likewise.

§param_infos: &'a [ParamInfo]

Static param metadata - the chunker keys is_chunked(id) off ParamFlags::CHUNKED here. Wrappers cache this once when the plugin instantiates (via Params::param_infos_static) and pass the same slice on every block.

§min_subblock_samples: u32

Minimum sub-block size in samples. From crate::info::AutomationConfig::min_subblock_samples. Events whose sample_offset falls within min_subblock_samples of the current sub-block start are coalesced into that sub-block’s leading apply_pending_events batch instead of triggering a split.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ChunkedProcess<'a>

§

impl<'a> !Send for ChunkedProcess<'a>

§

impl<'a> !Sync for ChunkedProcess<'a>

§

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

§

impl<'a> Freeze for ChunkedProcess<'a>

§

impl<'a> Unpin for ChunkedProcess<'a>

§

impl<'a> UnsafeUnpin for ChunkedProcess<'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.