Skip to main content

Crate plughost_formats

Crate plughost_formats 

Source
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 AUAudioUnit for 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§

EditorRequest
What a plugin asked of its editor window. A later request replaces one not yet served.
EditorView
Where an opened editor draws.

Traits§

AudioThread
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.flush while active, reset, and stop_processing before deactivation. A plugin without one makes these calls on the thread that asks for them, as its audio thread for that call.
BlockProcessor
Processes a plugin from a processing thread. It is sealed: the format processors of this crate implement it.
HostedPlugin
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 plugin names, in this process.

Type Aliases§

ResizeRequest
Called when a plugin asks for a new editor size; returns whether the host window now has that size.