Expand description
In-process VST3, Audio Unit, and CLAP hosting for plughost.
Plugins are loaded into the calling process. Load plugins, change their lifecycle, and use their controllers on one thread, normally the main thread; plugins that show dialogs or editors need that thread to run the OS event loop. Applications that need crash isolation use the plughost crate, which runs these hosts in helper processes.
load creates a plugin of any enabled format from a PluginRef; each format’s Plugin can
also be created directly, from a loaded vst3::Module or clap::Entry, or from an Audio Unit
class ID. Loading is the step that runs the plugin’s own code, which nothing can check:
load, vst3::Module::load, clap::Entry::load and au::Plugin::new are unsafe fn, and
reading a loaded plugin afterwards is safe. Every plugin is used through HostedPlugin and
processed from another thread through the BlockProcessor it hands out. Every format fails with one
Error, which tells the FailureKind, the format, the native
result code and the cause. An owner that processes plugins on a thread of its own gives them an
AudioThread, so the audio-thread calls they need between blocks run there too. Plugins
process, reset and flush with subnormal numbers flushed to zero (MXCSR FTZ and DAZ on x86-64,
FPCR.FZ on AArch64); the calling thread’s mode is restored after each call.
The detailed API guide describes format capabilities and the application-level processing contracts.
Modules§
- au
- Audio Unit hosting (macOS), through
AUAudioUnitfor both v2 and v3 units. - clap
- CLAP hosting, through clack-host.
- preset
- Native preset containers. File I/O belongs to the caller; CLAP has no common state file codec.
- vst3
- VST3 hosting.
Structs§
- Error
- A failure of an in-process plugin host or of the native plugin it hosts.
Enums§
- Editor
Request - What a plugin asked of its editor window. A later request replaces one not yet served.
- Editor
View - Where an opened editor draws.
Traits§
- Audio
Thread - Runs the audio-thread calls a plugin needs outside the blocks it processes on the thread that
processes it, so the plugin sees them on its audio thread: delivering edits to a prepared VST3
processor with a process call without audio, and CLAP
params.flushwhile active,reset, andstop_processingbefore deactivation. A plugin without one makes these calls on the thread that asks for them, as its audio thread for that call. - Block
Processor - Processes a plugin from a processing thread. It is sealed: the format processors of this crate implement it.
- Hosted
Plugin - A plugin instance, used on the thread that created it. It is sealed: the format plugins of this crate implement it.
Functions§
- load⚠
- Loads the plugin class
pluginnames, in this process.
Type Aliases§
- Resize
Request - Called when a plugin asks for a new editor size; returns whether the host window now has that size.