pub struct RecordingSink<T: Transcendental, const B: usize> { /* private fields */ }Expand description
Sink node that records stereo signal into a shared buffer.
§Usage
let buf = Arc::new(Mutex::new(Vec::new()));
let sink = RecordingSink::<f32, 256>::new(buf.clone(), 2);
// ... build graph, run ...
let data = buf.lock().unwrap();
RecordingSink::<f32, 256>::write_wav("output.wav", 44100, 2, &data).unwrap();Implementations§
Source§impl<T: Transcendental, const B: usize> RecordingSink<T, B>
impl<T: Transcendental, const B: usize> RecordingSink<T, B>
Trait Implementations§
Source§impl<T: Transcendental, const B: usize> Node<T, B> for RecordingSink<T, B>
impl<T: Transcendental, const B: usize> Node<T, B> for RecordingSink<T, B>
Source§fn node_type_id(&self) -> NodeTypeIdwhere
Self: 'static + Sized,
fn node_type_id(&self) -> NodeTypeIdwhere
Self: 'static + Sized,
Get the node’s type ID
Source§fn metadata(&self) -> NodeMetadata
fn metadata(&self) -> NodeMetadata
Get node metadata
Source§fn get_parameter(&self, _id: &ParameterId) -> Option<ParamValue>
fn get_parameter(&self, _id: &ParameterId) -> Option<ParamValue>
Get the value of a parameter
Source§fn set_parameter(
&mut self,
_id: &ParameterId,
_value: ParamValue,
) -> ProcessResult<()>
fn set_parameter( &mut self, _id: &ParameterId, _value: ParamValue, ) -> ProcessResult<()>
Set the value of a parameter
Source§fn input_port_mut(&mut self, index: usize) -> Option<&mut Port<T, B>>
fn input_port_mut(&mut self, index: usize) -> Option<&mut Port<T, B>>
Get mutable input port by index
Source§fn output_port_mut(&mut self, _index: usize) -> Option<&mut Port<T, B>>
fn output_port_mut(&mut self, _index: usize) -> Option<&mut Port<T, B>>
Get mutable output port by index
Source§fn control_port_mut(&mut self, _index: usize) -> Option<&mut Port<T, B>>
fn control_port_mut(&mut self, _index: usize) -> Option<&mut Port<T, B>>
Get mutable control port by index
Source§fn num_signal_inputs(&self) -> usize
fn num_signal_inputs(&self) -> usize
Number of signal input ports
Source§fn num_signal_outputs(&self) -> usize
fn num_signal_outputs(&self) -> usize
Number of signal output ports
Source§fn apply_set_parameter(
&mut self,
cmd: &SetParameter,
) -> Result<(), ProcessError>
fn apply_set_parameter( &mut self, cmd: &SetParameter, ) -> Result<(), ProcessError>
Apply a
SetParameter command to this node. Read moreSource§fn resolve_resources(&mut self, _resources: &mut ResourceRegistry<T>)
fn resolve_resources(&mut self, _resources: &mut ResourceRegistry<T>)
Resolve named shared resources (tape loops, etc.) from the registry,
acquiring the capability handle matching this node’s role.
Source§fn num_control_inputs(&self) -> usize
fn num_control_inputs(&self) -> usize
Number of control input ports
Source§fn num_control_outputs(&self) -> usize
fn num_control_outputs(&self) -> usize
Number of control output ports
Source§fn num_clock_inputs(&self) -> usize
fn num_clock_inputs(&self) -> usize
Number of clock input ports
Source§fn num_clock_outputs(&self) -> usize
fn num_clock_outputs(&self) -> usize
Number of clock output ports
Source§fn num_feedback_ports(&self) -> usize
fn num_feedback_ports(&self) -> usize
Number of feedback ports
Source§fn num_inputs(&self) -> usize
fn num_inputs(&self) -> usize
Total number of input ports
Source§fn num_outputs(&self) -> usize
fn num_outputs(&self) -> usize
Total number of output ports
Source§impl<T: Transcendental, const B: usize> Sink<T, B> for RecordingSink<T, B>
impl<T: Transcendental, const B: usize> Sink<T, B> for RecordingSink<T, B>
Source§fn consume(
&mut self,
_ctx: &RenderContext,
_signal_inputs: &[&[T; B]],
_control_inputs: &[T],
_clock_inputs: &[RenderContext],
_feedback_inputs: &[&[T; B]],
_tick: &ClockTick,
) -> ProcessResult<()>
fn consume( &mut self, _ctx: &RenderContext, _signal_inputs: &[&[T; B]], _control_inputs: &[T], _clock_inputs: &[RenderContext], _feedback_inputs: &[&[T; B]], _tick: &ClockTick, ) -> ProcessResult<()>
Consume a block of signal Read more
Source§fn set_playback(&mut self, _playback: Arc<dyn IoPlayback>)
fn set_playback(&mut self, _playback: Arc<dyn IoPlayback>)
Attach a playback backend. No-op by default; I/O nodes override.
Auto Trait Implementations§
impl<T, const B: usize> !RefUnwindSafe for RecordingSink<T, B>
impl<T, const B: usize> !UnwindSafe for RecordingSink<T, B>
impl<T, const B: usize> Freeze for RecordingSink<T, B>where
T: Freeze,
impl<T, const B: usize> Send for RecordingSink<T, B>
impl<T, const B: usize> Sync for RecordingSink<T, B>
impl<T, const B: usize> Unpin for RecordingSink<T, B>where
T: Unpin,
impl<T, const B: usize> UnsafeUnpin for RecordingSink<T, B>where
T: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more