ladspa_abi.h
The LADSPA binary interface, declared from the specification.
#include <sonore/ladspa_abi.h>- 2types
- 25other declarations
- Guides: Hosting plugins
On this page
Design notes
Why these declarations are ours
LADSPA is a C ABI: one exported function, ladspa_descriptor, that hands out descriptor structs by index, and a handful of integer flags. The ABI itself is a fact about how existing binaries are laid out and cannot be owned by anybody. The header that is conventionally #included to get it, however, is LGPL, and an Apache-2.0 header-only SDK that pulled it in would hand every plugin that includes host.h a licence question it never asked.
So the layout is written here from the specification's text, not copied: the same fields in the same order, with this SDK's names. Nothing here may be reordered or resized. Every field is read by binaries compiled against the original declarations, and a struct that is one int out of step with theirs reads the port count from the copyright string.
unsigned long, deliberately
The specification types its indices and counts as unsigned long, and that is 32 bits on Windows and 64 on Linux and macOS. It looks like the very thing a fixed-width integer should replace, and replacing it would break the ABI on exactly one of the platforms: a plugin built with the original header has unsigned long in its struct, so ours must too.
Types 2
One port's presentation hints. The bounds mean something only where the matching kHintBounded* bit is set.
One plugin type. A library may export several, indexed from 0 until the entry point returns null.
The field order is the ABI. See the file comment.
Constants 25
- const
constexpr Properties kPropertyRealtime = 0x1run() is real-time safe in the usual sense: no allocation, no waiting.ladspa::kPropertyRealtime · ladspa_abi.h:37 - const
constexpr Properties kPropertyInplaceBroken = 0x2An output buffer may NOT be the same as an input buffer. A host that runs plugins in place must give such a plugin separate buffers.ladspa::kPropertyInplaceBroken · ladspa_abi.h:40 - const
constexpr Properties kPropertyHardRtCapable = 0x4Safe to run on a hard real-time thread.ladspa::kPropertyHardRtCapable · ladspa_abi.h:42 - const
constexpr PortDescriptor kPortInput = 0x1ladspa::kPortInput · ladspa_abi.h:46 - const
constexpr PortDescriptor kPortOutput = 0x2ladspa::kPortOutput · ladspa_abi.h:47 - const
constexpr PortDescriptor kPortControl = 0x4ladspa::kPortControl · ladspa_abi.h:48 - const
constexpr PortDescriptor kPortAudio = 0x8ladspa::kPortAudio · ladspa_abi.h:49 - const
constexpr HintDescriptor kHintBoundedBelow = 0x1ladspa::kHintBoundedBelow · ladspa_abi.h:54 - const
constexpr HintDescriptor kHintBoundedAbove = 0x2ladspa::kHintBoundedAbove · ladspa_abi.h:55 - const
constexpr HintDescriptor kHintToggled = 0x4On or off: 0 is off, anything above is on. The bounds are meaningless.ladspa::kHintToggled · ladspa_abi.h:57 - const
constexpr HintDescriptor kHintSampleRate = 0x8The bounds are FRACTIONS of the sample rate, to be multiplied by it.ladspa::kHintSampleRate · ladspa_abi.h:59 - const
constexpr HintDescriptor kHintLogarithmic = 0x10The control is best presented on a logarithmic scale.ladspa::kHintLogarithmic · ladspa_abi.h:61 - const
constexpr HintDescriptor kHintInteger = 0x20Integer values only.ladspa::kHintInteger · ladspa_abi.h:63 - const
constexpr HintDescriptor kHintDefaultMask = 0x3C0The default selector: (hint & kHintDefaultMask) is one of the values below. The specification computes the "low", "middle" and "high" defaults from the bounds -- geometrically when kHintLogarithmic is set -- so the value itself is never stored.ladspa::kHintDefaultMask · ladspa_abi.h:69 - const
constexpr HintDescriptor kHintDefaultNone = 0x0ladspa::kHintDefaultNone · ladspa_abi.h:70 - const
constexpr HintDescriptor kHintDefaultMinimum = 0x40ladspa::kHintDefaultMinimum · ladspa_abi.h:71 - const
constexpr HintDescriptor kHintDefaultLow = 0x80ladspa::kHintDefaultLow · ladspa_abi.h:72 - const
constexpr HintDescriptor kHintDefaultMiddle = 0xC0ladspa::kHintDefaultMiddle · ladspa_abi.h:73 - const
constexpr HintDescriptor kHintDefaultHigh = 0x100ladspa::kHintDefaultHigh · ladspa_abi.h:74 - const
constexpr HintDescriptor kHintDefaultMaximum = 0x140ladspa::kHintDefaultMaximum · ladspa_abi.h:75 - const
constexpr HintDescriptor kHintDefault0 = 0x200ladspa::kHintDefault0 · ladspa_abi.h:76 - const
constexpr HintDescriptor kHintDefault1 = 0x240ladspa::kHintDefault1 · ladspa_abi.h:77 - const
constexpr HintDescriptor kHintDefault100 = 0x280ladspa::kHintDefault100 · ladspa_abi.h:78 - const
constexpr HintDescriptor kHintDefault440 = 0x2C0ladspa::kHintDefault440 · ladspa_abi.h:79 - const
constexpr const char* kEntryPointName = "ladspa_descriptor"The exported symbol's name, spelled once.ladspa::kEntryPointName · ladspa_abi.h:137