pub struct ProcInfo {Show 17 fields
pub frames: usize,
pub in_silence_mask: SilenceMask,
pub out_silence_mask: SilenceMask,
pub in_constant_mask: ConstantMask,
pub out_constant_mask: ConstantMask,
pub in_connected_mask: ConnectedMask,
pub out_connected_mask: ConnectedMask,
pub sample_rate: NonZeroU32,
pub sample_rate_recip: f64,
pub clock_samples: InstantSamples,
pub total_cpu_seconds_recip: f64,
pub duration_since_stream_start: Duration,
pub stream_status: StreamStatus,
pub dropped_frames: u32,
pub process_to_playback_delay: Option<Duration>,
pub did_just_unbypass: bool,
pub transport_info: Option<TransportInfo>,
}Expand description
Information for AudioNodeProcessor::process
Fields§
§frames: usizeThe number of frames (samples in a single channel of audio) in this processing block.
Not to be confused with video frames.
in_silence_mask: SilenceMaskAn optional optimization hint on which input channels contain
all zeros (silence). The first bit (0x1) is the first channel,
the second bit is the second channel, and so on.
out_silence_mask: SilenceMaskAn optional optimization hint on which output channels contain
all zeros (silence). The first bit (0x1) is the first channel,
the second bit is the second channel, and so on.
in_constant_mask: ConstantMaskAn optional optimization hint on which input channels have all
samples set to the same value. The first bit (0x1) is the
first channel, the second bit is the second channel, and so on.
This can be useful for nodes that use audio buffers as CV (control voltage) ports.
out_constant_mask: ConstantMaskAn optional optimization hint on which input channels have all
samples set to the same value. The first bit (0x1) is the
first channel, the second bit is the second channel, and so on.
This can be useful for nodes that use audio buffers as CV (control voltage) ports.
in_connected_mask: ConnectedMaskAn optional hint on which input channels are connected to other nodes in the graph.
out_connected_mask: ConnectedMaskAn optional hint on which output channels are connected to other nodes in the graph.
sample_rate: NonZeroU32The sample rate of the audio stream in samples per second.
sample_rate_recip: f64The reciprocal of the sample rate. This can be used to avoid a division and improve performance.
clock_samples: InstantSamplesThe current time of the audio clock at the first frame in this processing block, equal to the total number of frames (samples in a single channel of audio) that have been processed since this Firewheel context was first started.
Note, this value does NOT account for any output underflows (underruns) that may have occurred.
Note, generally this value will always count up, but there may be a few edge cases that cause this value to be less than the previous block, such as when the sample rate of the stream has been changed.
total_cpu_seconds_recip: f64The reciprocal of the total amount of seconds that the CPU can spend in this call to the Firewheel Processor’s process method before underruns will occur.
This can be used for performance profiling.
duration_since_stream_start: DurationThe duration between when the stream was started an when the
Firewheel processor’s process method was called.
Note, this clock is not as accurate as the audio clock.
stream_status: StreamStatusFlags indicating the current status of the audio stream
dropped_frames: u32If an output underflow (underrun) occurred, then this will contain an estimate for the number of frames (samples in a single channel of audio) that were dropped.
This can be used to correct the timing of events if desired.
Note, this is just an estimate, and may not always be perfectly accurate.
If an underrun did not occur, then this will be 0.
process_to_playback_delay: Option<Duration>The estimated time between when this process loop was called and when the data will be delivered to the output device for playback.
If the audio backend does not provide this information, then this
will be None.
did_just_unbypass: boolIf the node has just been un-bypassed, then this will be true.
transport_info: Option<TransportInfo>Information about the musical transport.
This will be None if no musical transport is currently active,
or if the current transport is currently paused.
Implementations§
Source§impl ProcInfo
impl ProcInfo
Sourcepub fn clock_seconds(&self) -> InstantSeconds
pub fn clock_seconds(&self) -> InstantSeconds
The current time of the audio clock at the first frame in this processing block, equal to the total number of seconds of data that have been processed since this Firewheel context was first started.
Note, this value does NOT account for any output underflows (underruns) that may have occurred.
Note, generally this value will always count up, but there may be a few edge cases that cause this value to be less than the previous block, such as when the sample rate of the stream has been changed.
Sourcepub fn clock_samples_range(&self) -> Range<InstantSamples>
pub fn clock_samples_range(&self) -> Range<InstantSamples>
Get the current time of the audio clock in frames as a range for this processing block.
Sourcepub fn clock_seconds_range(&self) -> Range<InstantSeconds>
pub fn clock_seconds_range(&self) -> Range<InstantSeconds>
Get the current time of the audio clock in frames as a range for this processing block.
Sourcepub fn playhead(&self) -> Option<InstantMusical>
pub fn playhead(&self) -> Option<InstantMusical>
Get the playhead of the transport at the first frame in this processing block.
If there is no active transport, or if the transport is not currently
playing, then this will return None.
Sourcepub fn playhead_range(&self) -> Option<Range<InstantMusical>>
pub fn playhead_range(&self) -> Option<Range<InstantMusical>>
Get the playhead of the transport as a range for this processing block.
If there is no active transport, or if the transport is not currently
playing, then this will return None.
Sourcepub fn transport_is_playing(&self) -> bool
pub fn transport_is_playing(&self) -> bool
Returns true if there is a transport and that transport is playing,
false otherwise.
Sourcepub fn musical_to_samples(
&self,
musical: InstantMusical,
) -> Option<InstantSamples>
pub fn musical_to_samples( &self, musical: InstantMusical, ) -> Option<InstantSamples>
Converts the given musical time to the corresponding time in samples.
If there is no musical transport or the transport is not currently playing,
then this will return None.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcInfo
impl RefUnwindSafe for ProcInfo
impl Send for ProcInfo
impl Sync for ProcInfo
impl Unpin for ProcInfo
impl UnsafeUnpin for ProcInfo
impl UnwindSafe for ProcInfo
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
impl<T> ConditionalSend for Twhere
T: Send,
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.