Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::lv2_adapter::Lv2PortLayout Struct Reference

The single definition of a Pulp LV2 plugin's port ordering. More...

#include <lv2_adapter.hpp>

Public Member Functions

constexpr int audio_in_begin () const noexcept
constexpr int audio_out_begin () const noexcept
constexpr int control_begin () const noexcept
constexpr int atom_in_begin () const noexcept
constexpr int atom_out_begin () const noexcept
constexpr int latency_index () const noexcept
constexpr int port_count () const noexcept
 Total ports this plugin declares, latency port included.
constexpr Lv2PortKind kind_of (int port) const noexcept
 Classify a port number.
constexpr int slot_of (int port) const noexcept
 Offset of port within its own kind — the array index for the multi-slot kinds, and 0 for the single-slot ones.

Public Attributes

int num_audio_inputs = 0
int num_audio_outputs = 0
int num_params = 0
bool accepts_midi = false
bool produces_midi = false

Detailed Description

The single definition of a Pulp LV2 plugin's port ordering.

LV2 names a port by a bare integer and nothing else: the manifest writes it as lv2:index N and the host hands the same integer back to connect_port(). generate_plugin_ttl() and connect_port() both derive their indices from this type, so the manifest a host reads and the slot the adapter wires cannot disagree — a disagreement delivers a float* where an LV2_Atom_Sequence is read, which compiles, links and loads.

The order is: every audio input channel, every audio output channel, one control port per parameter, the atom input port when the plugin accepts MIDI, the atom output port when it produces MIDI, then the latency output control port, always last. A host saves a session's port connections by index, so inserting a port renumbers every port after it and reconnects an existing session's ports to the wrong slots. Changing this order is a compatibility event.

Member Function Documentation

◆ atom_in_begin()

int pulp::format::lv2_adapter::Lv2PortLayout::atom_in_begin ( ) const
inlinenodiscardconstexprnoexcept

◆ atom_out_begin()

int pulp::format::lv2_adapter::Lv2PortLayout::atom_out_begin ( ) const
inlinenodiscardconstexprnoexcept

◆ audio_in_begin()

int pulp::format::lv2_adapter::Lv2PortLayout::audio_in_begin ( ) const
inlinenodiscardconstexprnoexcept

◆ audio_out_begin()

int pulp::format::lv2_adapter::Lv2PortLayout::audio_out_begin ( ) const
inlinenodiscardconstexprnoexcept

◆ control_begin()

int pulp::format::lv2_adapter::Lv2PortLayout::control_begin ( ) const
inlinenodiscardconstexprnoexcept

◆ kind_of()

Lv2PortKind pulp::format::lv2_adapter::Lv2PortLayout::kind_of ( int port) const
inlinenodiscardconstexprnoexcept

Classify a port number.

Every range is checked at both ends, so a negative or past-the-end index resolves to None rather than to a slot.

◆ latency_index()

int pulp::format::lv2_adapter::Lv2PortLayout::latency_index ( ) const
inlinenodiscardconstexprnoexcept

◆ port_count()

int pulp::format::lv2_adapter::Lv2PortLayout::port_count ( ) const
inlinenodiscardconstexprnoexcept

Total ports this plugin declares, latency port included.

◆ slot_of()

int pulp::format::lv2_adapter::Lv2PortLayout::slot_of ( int port) const
inlinenodiscardconstexprnoexcept

Offset of port within its own kind — the array index for the multi-slot kinds, and 0 for the single-slot ones.

Meaningless for a port kind_of() calls None.

Member Data Documentation

◆ accepts_midi

bool pulp::format::lv2_adapter::Lv2PortLayout::accepts_midi = false

◆ num_audio_inputs

int pulp::format::lv2_adapter::Lv2PortLayout::num_audio_inputs = 0

◆ num_audio_outputs

int pulp::format::lv2_adapter::Lv2PortLayout::num_audio_outputs = 0

◆ num_params

int pulp::format::lv2_adapter::Lv2PortLayout::num_params = 0

◆ produces_midi

bool pulp::format::lv2_adapter::Lv2PortLayout::produces_midi = false

The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/format/include/pulp/format/lv2_adapter.hpp