pub enum ProcessMode {
Realtime,
Buffered,
Offline,
}Expand description
How the host is driving audio through the plugin this activation.
Delivered two ways that answer two different questions.
AudioConfig::process_mode at reset answers “how big should my
buffers be for this render?” - the allocation-relevant question, since
buffer sizing has to happen off the audio thread. The per-block
ProcessContext::process_mode answers “may I skip the realtime
discipline right now?” - it tracks host toggles that don’t warrant a
re-prepare (VST3 kRealtime <-> kPrefetch, an LV2 freewheel port).
Variants§
Realtime
Fixed-rate realtime playback. Honor the no-alloc / no-lock rule.
Buffered
Real-time-like but processed ahead at irregular intervals to
loosen realtime pressure. Only VST3 (kPrefetch) produces this.
Treat it like Realtime unless there is a
specific reason to relax discipline.
Offline
Freewheeling offline render. No wall-clock deadline: a plugin may allocate, raise oversampling, lengthen lookahead, and trade CPU for quality.
Implementations§
Source§impl ProcessMode
impl ProcessMode
Sourcepub fn is_offline(self) -> bool
pub fn is_offline(self) -> bool
Whether the host is freewheeling with no realtime deadline. True
only for Offline - the one mode where relaxing
the no-alloc / no-lock rule and raising quality is safe.
Sourcepub fn as_u8(self) -> u8
pub fn as_u8(self) -> u8
Discriminant for atomic storage. Wrappers whose offline signal
arrives on one thread (CLAP render::set, an AU property) and is
read on the audio thread stash the mode in an AtomicU8.
Sourcepub fn from_u8(v: u8) -> Self
pub fn from_u8(v: u8) -> Self
Inverse of Self::as_u8. Any unknown value maps to
Realtime, the safe default.
Trait Implementations§
Source§impl Clone for ProcessMode
impl Clone for ProcessMode
Source§fn clone(&self) -> ProcessMode
fn clone(&self) -> ProcessMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more