pub struct AudioNodeInfo { /* private fields */ }Expand description
Information about an AudioNode.
This struct enforces the use of the builder pattern for future-proofness, as it is likely that more fields will be added in the future.
Implementations§
Source§impl AudioNodeInfo
impl AudioNodeInfo
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct a new AudioNodeInfo builder struct.
Sourcepub const fn debug_name(self, debug_name: &'static str) -> Self
pub const fn debug_name(self, debug_name: &'static str) -> Self
A unique name for this type of node, used for debugging purposes.
Sourcepub const fn channel_config(self, channel_config: ChannelConfig) -> Self
pub const fn channel_config(self, channel_config: ChannelConfig) -> Self
The channel configuration of this node.
By default this has a channel configuration with zero input and output channels.
WARNING: Audio nodes MUST either completely fill all output buffers
with data, or return ProcessStatus::ClearAllOutputs/ProcessStatus::Bypass.
Failing to do this will result in audio glitches.
Sourcepub const fn is_pre_process(self) -> Self
pub const fn is_pre_process(self) -> Self
Specify that this node is a “pre process” node. Pre-process nodes have zero inputs and outputs, and they are processed before all other nodes in the graph.
Sourcepub const fn call_update_method(self, call_update_method: bool) -> Self
pub const fn call_update_method(self, call_update_method: bool) -> Self
Set to true if this node wishes to have the Firewheel context call
AudioNode::update on every update cycle.
By default this is set to false.
Sourcepub fn custom_state<T: 'static>(self, custom_state: T) -> Self
pub fn custom_state<T: 'static>(self, custom_state: T) -> Self
Custom !Send state that can be stored in the Firewheel context and accessed
by the user.
The user accesses this state via FirewheelCtx::node_state and
FirewheelCtx::node_state_mut.
Sourcepub const fn latency_frames(self, latency_frames: u32) -> Self
pub const fn latency_frames(self, latency_frames: u32) -> Self
Set the latency of this node in frames (samples in a single channel of audio).
By default this is set to 0.
Trait Implementations§
Source§impl Debug for AudioNodeInfo
impl Debug for AudioNodeInfo
Source§impl Default for AudioNodeInfo
impl Default for AudioNodeInfo
Source§impl From<AudioNodeInfo> for AudioNodeInfoInner
impl From<AudioNodeInfo> for AudioNodeInfoInner
Source§fn from(value: AudioNodeInfo) -> Self
fn from(value: AudioNodeInfo) -> Self
Auto Trait Implementations§
impl Freeze for AudioNodeInfo
impl !RefUnwindSafe for AudioNodeInfo
impl !Send for AudioNodeInfo
impl !Sync for AudioNodeInfo
impl Unpin for AudioNodeInfo
impl !UnwindSafe for AudioNodeInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().