pub struct JackGraphBridge<P> { /* private fields */ }Expand description
Drives an audio processor from a JACK process callback.
Implementations§
Source§impl<P: Processor> JackGraphBridge<P>
impl<P: Processor> JackGraphBridge<P>
Sourcepub fn new(
processor: P,
spec: PcmSpec,
input_channels: usize,
max_block_frames: u32,
) -> Result<Self>
pub fn new( processor: P, spec: PcmSpec, input_channels: usize, max_block_frames: u32, ) -> Result<Self>
Builds a bridge wrapping processor for a JACK client.
The processor is prepared once with the PCM spec sample rate, the
max_block_frames upper bound, the input_channels count, and the
spec output channel count. Scratch storage is sized to the largest
block the callback may deliver.
§Errors
Returns an error when max_block_frames is zero or when either channel
count exceeds u16.
Sourcepub fn process_interleaved_f32(
&mut self,
input: Option<&[f32]>,
frames: usize,
transport: JackTransportState,
midi_events: &[JackMidiEvent],
) -> Result<Vec<f32>>
pub fn process_interleaved_f32( &mut self, input: Option<&[f32]>, frames: usize, transport: JackTransportState, midi_events: &[JackMidiEvent], ) -> Result<Vec<f32>>
Runs one process block and returns interleaved output samples.
input is interleaved capture audio (or silence when None), frames
is the block length, transport is the current JACK transport snapshot,
and midi_events are the short MIDI events for the block. The samples
are deinterleaved to planar buffers, the wrapped processor runs, and the
planar output is reinterleaved. The transport snapshot is retained for
last_transport.
§Errors
Returns an error when frames exceeds the configured maximum block
size, when interleaving conversions fail, or when the processor’s audio
lanes fail validation.
Sourcepub fn last_transport(&self) -> JackTransportState
pub fn last_transport(&self) -> JackTransportState
Returns the transport snapshot from the most recent process block.