Skip to main content

Crate maolan_plugin_host

Crate maolan_plugin_host 

Source

Modules§

clap
events
gui_win32
Shared Win32 container-window helpers for hosting plugin GUIs.
gui_x11
Shared X11 container-window helpers for hosting plugin GUIs.
host
lv2
paths
protocol
ringbuf
scan
shm
util
vst3
vst3_lv2_host

Structs§

EventPair
Lightweight cross-process event signalling.
MidiEvent
Fixed-size MIDI event (16 bytes, 16-byte aligned).
ParameterEvent
Fixed-size parameter change event (16 bytes, 16-byte aligned).
RingBuffer
Lock-free single-producer / single-consumer ring buffer backed by a fixed array in shared memory.
ShmHeader
Shared-memory header (256 bytes).
ShmMapping
Owned mapping of a shared-memory segment.
TransportState
Transport state block (256 bytes).

Constants§

AUDIO_BUFFER_SIZE
AUDIO_OFFSET
Audio buffers start after the control area.
CONTROL_OFFSET
Control area starts right after the header.
CONTROL_SIZE
ECHO_READ_IDX_OFFSET
ECHO_RING_OFFSET
ECHO_RING_SIZE
ECHO_WRITE_IDX_OFFSET
HEADER_SIZE
LAYOUT_SIZE
Total bytes actively used by the protocol layout.
MAGIC
Magic number: “MAOL” in big-endian ASCII.
MAX_BLOCK_SIZE
Maximum audio block size in samples.
MAX_CHANNELS
Maximum number of audio channels (main + sidechain combined).
MIDI_OUT_READ_IDX_OFFSET
MIDI_OUT_RING_OFFSET
MIDI_OUT_RING_SIZE
MIDI_OUT_WRITE_IDX_OFFSET
MIDI_READ_IDX_OFFSET
MIDI_RING_OFFSET
MIDI ring buffer.
MIDI_RING_SIZE
MIDI_WRITE_IDX_OFFSET
NUM_BUSES
Number of audio buses (main + sidechain).
PARAM_EVENT_GESTURE_BEGIN
PARAM_EVENT_GESTURE_END
PARAM_EVENT_MOD
PARAM_EVENT_VALUE
PARAM_READ_IDX_OFFSET
PARAM_RING_OFFSET
Parameter ring buffer.
PARAM_RING_SIZE
PARAM_WRITE_IDX_OFFSET
PORT_COUNTS_MAGIC
Magic value written before port counts in scratch.
RING_CAPACITY
Capacity of each ring buffer in slots (power of two).
SCRATCH_OFFSET
State blob scratch area.
SCRATCH_SIZE
SHM_SIZE
Total shared-memory allocation size (4 MiB, page-aligned).
TRANSPORT_OFFSET
Transport state block (256-byte aligned from here).
TRANSPORT_SIZE
VERSION
Current protocol version. Version 2: parent_window changed from AtomicU32 to AtomicU64 to support 64-bit HWNDs on Windows. Version 3: Added MIDI output ring for plugin-generated MIDI events.

Functions§

audio_channel_ptr
Returns a pointer to a specific channel/bus plane.
audio_ptr
Returns a pointer to the audio buffer region.
echo_indices
Returns pointers to the echo ring write/read atomics.
echo_ring_ptr
Returns a pointer to the echo ring buffer slot array.
header_mut
Returns a mutable reference to the header.
header_ref
Returns a reference to the header at the start of the mapping.
init_shm_layout
Zero-initialize the entire shared-memory region and write the header.
midi_indices
Returns pointers to the MIDI ring write/read atomics.
midi_out_indices
Returns pointers to the MIDI output ring write/read atomics.
midi_out_ring_ptr
Returns a pointer to the MIDI output ring buffer slot array.
midi_ring_ptr
Returns a pointer to the MIDI ring buffer slot array.
param_indices
Returns pointers to the parameter ring write/read atomics.
param_ring_ptr
Returns a pointer to the parameter ring buffer slot array.
read_plugin_name_from_scratch
Read a plugin name from the start of the scratch buffer.
read_port_counts_from_scratch
Read audio/MIDI port counts from scratch.
scratch_ptr
Returns a pointer to the scratch buffer region.
transport_mut
Returns a mutable reference to the transport state.
transport_ref
Returns a reference to the transport state.
wait_for_ready
Wait (spin + yield) until ready becomes non-zero or timeout elapses.
write_plugin_name_to_scratch
Write a plugin name to the start of the scratch buffer. The name is encoded as a little-endian u32 length followed by UTF-8 bytes.
write_port_counts_to_scratch
Write audio/MIDI port counts to scratch.