[−][src]Trait lv2::prelude::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 AtomPort
[src]
type InputPortType = PortReader<'static>
type OutputPortType = PortWriter<'static>
pub unsafe fn input_from_raw(
pointer: NonNull<c_void>,
_sample_count: u32
) -> PortReader<'static>
[src]
pointer: NonNull<c_void>,
_sample_count: u32
) -> PortReader<'static>
pub unsafe fn output_from_raw(
pointer: NonNull<c_void>,
_sample_count: u32
) -> PortWriter<'static>
[src]
pointer: NonNull<c_void>,
_sample_count: u32
) -> PortWriter<'static>
impl PortType for Audio
[src]
type InputPortType = &'static [f32]
type OutputPortType = &'static mut [f32]
pub unsafe fn input_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> <Audio as PortType>::InputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> <Audio as PortType>::InputPortType
pub unsafe fn output_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> <Audio as PortType>::OutputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> <Audio as PortType>::OutputPortType
impl PortType for CV
[src]
type InputPortType = &'static [f32]
type OutputPortType = &'static mut [f32]
pub unsafe fn input_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> <CV as PortType>::InputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> <CV as PortType>::InputPortType
pub unsafe fn output_from_raw(
pointer: NonNull<c_void>,
sample_count: u32
) -> <CV as PortType>::OutputPortType
[src]
pointer: NonNull<c_void>,
sample_count: u32
) -> <CV as PortType>::OutputPortType
impl PortType for Control
[src]
type InputPortType = f32
type OutputPortType = &'static mut f32
pub unsafe fn input_from_raw(
pointer: NonNull<c_void>,
_sample_count: u32
) -> f32
[src]
pointer: NonNull<c_void>,
_sample_count: u32
) -> f32
pub 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