[−][src]Trait lv2_core::port::PortType
Generalization of port types.
A port can read input or create a pointer to the output, but the exact type of input/output (pointer) depends on the type of port. This trait generalizes these types and behaviour.
Associated Types
type InputPortType: Sized
The type of input read by the port.
type OutputPortType: Sized
The type of output reference created by the port.
Required methods
unsafe fn input_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::InputPortType
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::InputPortType
Read data from the pointer or create a reference to the input.
If the resulting data is a slice, sample_count
is the length of the slice.
Safety
This method is unsafe because one needs to de-reference a raw pointer to implement this method.
unsafe fn output_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::OutputPortType
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::OutputPortType
Create a reference to the data where output should be written to.
If the data is a slice, sample_count
is the length of the slice.
Safety
This method is unsafe because one needs to de-reference a raw pointer to implement this method.
Implementors
impl PortType for Audio
[src]
type InputPortType = &'static [f32]
type OutputPortType = &'static mut [f32]
unsafe fn input_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::InputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::InputPortType
unsafe fn output_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::OutputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::OutputPortType
impl PortType for CV
[src]
type InputPortType = &'static [f32]
type OutputPortType = &'static mut [f32]
unsafe fn input_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::InputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::InputPortType
unsafe fn output_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::OutputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> Self::OutputPortType
impl PortType for Control
[src]
type InputPortType = f32
type OutputPortType = &'static mut f32
unsafe fn input_from_raw(pointer: NonNull<c_void>, _sample_count: u32) -> f32
[src]
unsafe fn output_from_raw(
pointer: NonNull<c_void>,
_sample_count: u32
) -> &'static mut f32
[src]
pointer: NonNull<c_void>,
_sample_count: u32
) -> &'static mut f32