pub struct SamplePlayerNode<T: Transcendental, const BUF_SIZE: usize> { /* private fields */ }Expand description
Sample-playback source node with stereo support.
§Parameters (all automatable via patchbay)
| Name | Type | Range | Description |
|---|---|---|---|
"gate" | Bool | – | Start / stop playback |
"rate" | Float | 0.0–4.0 | Playback speed ratio |
"loop_mode" | Choice | oneshot/forward/pingpong | Loop behaviour |
"start" | Float | 0.0–1.0 | Loop start (normalised) |
"end" | Float | 0.0–1.0 | Loop end (normalised) |
"amplitude" | Float | 0.0–1.0 | Output gain |
"interpolation" | Choice | linear/cubic | Interpolation mode |
"position" | Float | 0.0–1.0 | Current position (read-only) |
§Output ports
- Port 0: left channel
- Port 1: right channel (only present when a stereo sample is loaded)
Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> SamplePlayerNode<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> SamplePlayerNode<T, BUF_SIZE>
Trait Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> Default for SamplePlayerNode<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Default for SamplePlayerNode<T, BUF_SIZE>
Source§impl<T: Transcendental, const BUF_SIZE: usize> SignalNode<T, BUF_SIZE> for SamplePlayerNode<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> SignalNode<T, BUF_SIZE> for SamplePlayerNode<T, BUF_SIZE>
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, BUF_SIZE>>
fn input_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable input port by index
Source§fn output_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn output_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable output port by index
Source§fn control_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn control_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
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 node_type_id(&self) -> NodeTypeIdwhere
Self: Sized + 'static,
fn node_type_id(&self) -> NodeTypeIdwhere
Self: Sized + 'static,
Get the node’s type ID
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 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 BUF_SIZE: usize> Source<T, BUF_SIZE> for SamplePlayerNode<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Source<T, BUF_SIZE> for SamplePlayerNode<T, BUF_SIZE>
Source§fn generate(
&mut self,
clock: &ClockTick,
_control_inputs: &[T],
_clock_inputs: &[ClockTick],
) -> ProcessResult<()>
fn generate( &mut self, clock: &ClockTick, _control_inputs: &[T], _clock_inputs: &[ClockTick], ) -> ProcessResult<()>
Generate the next block of audio Read more
Source§fn num_signal_outputs(&self) -> usize
fn num_signal_outputs(&self) -> usize
Number of audio outputs (default 1)
Source§fn num_control_inputs(&self) -> usize
fn num_control_inputs(&self) -> usize
Number of control inputs (default 0)
Source§fn num_clock_inputs(&self) -> usize
fn num_clock_inputs(&self) -> usize
Number of clock inputs (default 0)
Auto Trait Implementations§
impl<T, const BUF_SIZE: usize> Freeze for SamplePlayerNode<T, BUF_SIZE>where
T: Freeze,
impl<T, const BUF_SIZE: usize> !RefUnwindSafe for SamplePlayerNode<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Send for SamplePlayerNode<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Sync for SamplePlayerNode<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Unpin for SamplePlayerNode<T, BUF_SIZE>where
T: Unpin,
impl<T, const BUF_SIZE: usize> UnsafeUnpin for SamplePlayerNode<T, BUF_SIZE>where
T: UnsafeUnpin,
impl<T, const BUF_SIZE: usize> !UnwindSafe for SamplePlayerNode<T, BUF_SIZE>
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