Skip to main content

JackGraphBridge

Struct JackGraphBridge 

Source
pub struct JackGraphBridge<P> { /* private fields */ }
Expand description

Drives an audio processor from a JACK process callback.

Implementations§

Source§

impl<P: Processor> JackGraphBridge<P>

Source

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.

Source

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.

Source

pub fn last_transport(&self) -> JackTransportState

Returns the transport snapshot from the most recent process block.

Source

pub fn reset(&mut self)

Resets the wrapped processor, scratch arena, and retained transport.

Trait Implementations§

Source§

impl<P: Debug> Debug for JackGraphBridge<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<P> Freeze for JackGraphBridge<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for JackGraphBridge<P>
where P: RefUnwindSafe,

§

impl<P> Send for JackGraphBridge<P>
where P: Send,

§

impl<P> Sync for JackGraphBridge<P>
where P: Sync,

§

impl<P> Unpin for JackGraphBridge<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for JackGraphBridge<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for JackGraphBridge<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.