MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / AudioNodeProcessor

Interface AudioNodeProcessor

crates/firewheel-core/src/node.rs:486–564  ·  view source on GitHub ↗

The trait describing the realtime processor counterpart to an audio node.

Source from the content-addressed store, hash-verified

484/// The trait describing the realtime processor counterpart to an
485/// audio node.
486pub trait AudioNodeProcessor: 'static + Send {
487 /// Called when there are new events for this node to process.
488 ///
489 /// This is called once before the first call to `process`, and after that
490 /// it will be called whenever there are new events (including when the
491 /// node is bypassed).
492 ///
493 /// Unless this node is bypassed, then [`AudioNodeProcessor::process`] will be
494 /// called immediately after.
495 ///
496 /// * `info` - Information about this processing block.
497 /// * `events` - A list of events for this node to process.
498 /// * `extra` - Additional buffers and utilities.
499 ///
500 /// This is always called in a realtime thread, so do not perform any
501 /// realtime-unsafe operations.
502 fn events(&mut self, info: &ProcInfo, events: &mut ProcEvents, extra: &mut ProcExtra) {
503 let _ = info;
504 let _ = events;
505 let _ = extra;
506 }
507
508 /// Called when the node has been fully bypassed/un-bypassed.
509 ///
510 /// The Firewheel processor automatically handles bypass declicking, so
511 /// there is no need to handle that manually.
512 ///
513 /// This is always called in a realtime thread, so do not perform any
514 /// realtime-unsafe operations.
515 fn bypassed(&mut self, bypassed: bool) {
516 let _ = bypassed;
517 }
518
519 /// Process the given block of audio.
520 ///
521 /// * `info` - Information about this processing block.
522 /// * `buffers` - The buffers of data to process.
523 /// * `extra` - Additional buffers and utilities.
524 ///
525 /// WARNING: Audio nodes *MUST* either completely fill all output buffers
526 /// with data, or return [`ProcessStatus::ClearAllOutputs`]/[`ProcessStatus::Bypass`].
527 /// Failing to do this will result in audio glitches. If using
528 /// [`AudioNodeInfo::in_place_buffers`], then the output buffers in the
529 /// range `[0..num_inputs_in_config.min(num_outputs_in_config)]` do not
530 /// need to be filled with data.
531 ///
532 /// This is always called in a realtime thread, so do not perform any
533 /// realtime-unsafe operations.
534 fn process(
535 &mut self,
536 info: &ProcInfo,
537 buffers: ProcBuffers,
538 extra: &mut ProcExtra,
539 ) -> ProcessStatus {
540 let _ = info;
541 let _ = buffers;
542 let _ = extra;
543

Callers

nothing calls this directly

Implementers 15

filter.rsexamples/custom_nodes/src/nodes/filter
noise_gen.rsexamples/custom_nodes/src/nodes/noise_
rms.rsexamples/custom_nodes/src/nodes/rms.rs
triple_buffer.rscrates/firewheel-nodes/src/triple_buff
beep_test.rscrates/firewheel-nodes/src/beep_test.r
volume.rscrates/firewheel-nodes/src/volume.rs
spatial_basic.rscrates/firewheel-nodes/src/spatial_bas
delay_compensation.rscrates/firewheel-nodes/src/delay_compe
mix.rscrates/firewheel-nodes/src/mix.rs
svf.rscrates/firewheel-nodes/src/svf.rs
fast_rms.rscrates/firewheel-nodes/src/fast_rms.rs
sampler.rscrates/firewheel-nodes/src/sampler.rs

Calls

no outgoing calls

Tested by

no test coverage detected