pub struct Lv2Port {
pub index: u32,
pub symbol: String,
pub name: String,
pub kind: Lv2PortKind,
pub dir: PortDir,
pub channels: u16,
}Expand description
One declared port of an Lv2PluginDescriptor.
Carries the LV2 port metadata and lowers to a graph PortDecl via
Lv2Port::to_port_decl.
Fields§
§index: u32The LV2 port index within its plugin.
symbol: StringThe LV2 port symbol, used as the graph port name.
name: StringThe human-readable port name.
kind: Lv2PortKindThe LV2 port class.
dir: PortDirThe signal direction (input or output).
channels: u16The number of graph lanes (channels) this port exposes.
Implementations§
Source§impl Lv2Port
impl Lv2Port
Sourcepub fn new(
index: u32,
symbol: impl Into<String>,
name: impl Into<String>,
kind: Lv2PortKind,
dir: PortDir,
channels: u16,
) -> Result<Self>
pub fn new( index: u32, symbol: impl Into<String>, name: impl Into<String>, kind: Lv2PortKind, dir: PortDir, channels: u16, ) -> Result<Self>
Builds a port from its fields, validating symbol, name, and channels.
§Errors
Returns Error::Eval when symbol or name is blank, or when
channels is zero.
Sourcepub fn audio_input(
index: u32,
symbol: impl Into<String>,
channels: u16,
) -> Result<Self>
pub fn audio_input( index: u32, symbol: impl Into<String>, channels: u16, ) -> Result<Self>
Builds an audio input port named “Audio Input” with channels lanes.
§Errors
Returns Error::Eval when symbol is blank or channels is zero.
Sourcepub fn audio_output(
index: u32,
symbol: impl Into<String>,
channels: u16,
) -> Result<Self>
pub fn audio_output( index: u32, symbol: impl Into<String>, channels: u16, ) -> Result<Self>
Builds an audio output port named “Audio Output” with channels lanes.
§Errors
Returns Error::Eval when symbol is blank or channels is zero.
Sourcepub fn control_input(
index: u32,
symbol: impl Into<String>,
name: impl Into<String>,
) -> Result<Self>
pub fn control_input( index: u32, symbol: impl Into<String>, name: impl Into<String>, ) -> Result<Self>
Builds a single-lane control input port with the given name.
§Errors
Returns Error::Eval when symbol or name is blank.
Sourcepub fn atom_input(index: u32, symbol: impl Into<String>) -> Result<Self>
pub fn atom_input(index: u32, symbol: impl Into<String>) -> Result<Self>
Builds a single-lane atom-sequence input port named “Events In”.
§Errors
Returns Error::Eval when symbol is blank.
Sourcepub fn to_port_decl(&self) -> PortDecl
pub fn to_port_decl(&self) -> PortDecl
Lowers this port to a graph PortDecl.