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 EventListSorted, 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 EventListPer-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 TransportInfoInitial 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: f64Host sample rate, plumbed through to each per-sub-block
ProcessContext.
output_events: &'a mut EventListPlugin’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: u32Minimum 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.