pub enum ChannelPair<'a, S> {
InputOnly(&'a [S]),
OutputOnly(&'a mut [S]),
InputOutput(&'a [S], &'a mut [S]),
InPlace(&'a mut [S]),
}Expand description
A pair of input and output channel buffers.
Because port and channel layouts may differ between inputs and outputs, a ChannelPair
may actually contain only an input or an output instead of both.
This enum also allows to check for the fairly common case where Host may re-use the same buffer for both the input and output, and expect the plugin to do in-place processing.
Variants§
InputOnly(&'a [S])
There is only an input channel present, there was no matching output.
OutputOnly(&'a mut [S])
There is only an output channel present, there was no matching input.
InputOutput(&'a [S], &'a mut [S])
Both the input and output channels are present, and available separately.
InPlace(&'a mut [S])
Both the input and output channels are present, but they actually share the same buffer.
In this case, the slice is already filled with the input channel’s data, and the host considers the contents of this buffer after processing to be the output channel’s data.
Implementations§
Source§impl<'a, S> ChannelPair<'a, S>
impl<'a, S> ChannelPair<'a, S>
Sourcepub fn input(&'a self) -> Option<&'a [S]>
pub fn input(&'a self) -> Option<&'a [S]>
Attempts to retrieve the input channel’s buffer data, if the input channel is present.
Sourcepub fn output(&'a self) -> Option<&'a [S]>
pub fn output(&'a self) -> Option<&'a [S]>
Attempts to retrieve a read-only reference to the output channel’s buffer data, if the output channel is present.
Sourcepub fn output_mut(&'a mut self) -> Option<&'a mut [S]>
pub fn output_mut(&'a mut self) -> Option<&'a mut [S]>
Attempts to retrieve a read-write reference to the output channel’s buffer data, if the output channel is present.