Expand description
Standalone host for truce plugins.
Runs a plugin cdylib with direct cpal audio I/O and an optional
GUI window (via baseview + the plugin’s own Editor). Zero
plugin-library code is required - the runner obtains the editor
via PluginExport::editor(), the same API every format wrapper
uses.
§Entry point
Plugins supply a [[bin]] <suffix>-standalone target with a
src/main.rs that calls:
ⓘ
fn main() {
truce_standalone::run::<my_plugin::Plugin>();
}§Modes
- Windowed (default, requires
guifeature): opens a baseview window hosting the plugin’s editor, drives a cpal stream on the audio thread. - Headless (
--headlessflag or theguifeature disabled): audio only. For effects this means audio passes through; for instruments the plugin emits silence unless a MIDI device is connected (--midi-input; seemidi).
See cli for the full flag surface.
Modules§
- audio
- Shared cpal audio setup + callback. One implementation used by
both
windowedandheadlessrunners. - cli
- CLI parser with strict precedence.
- headless
- Headless standalone: audio + MIDI device input, no window.
- keyboard
- QWERTY keyboard to MIDI note mapping.
- midi
- MIDI device input via
midir. - presets
- Preset library access for the standalone host.
- state
--state <path>load helper, shared bywindowed,headless, andofflinerunners. Wrapstruce_core::state::restore_pluginwith a uniform diagnostic surface so users see the same failure messages no matter which mode they launched in.- transport
- Minimal transport model for standalone mode.
Structs§
- Defaults
- Plugin-author launch defaults - used as the lowest tier of the
CLI parser, beneath argv and
TRUCE_STANDALONE_*env vars. EmptyDefaults::default()lets every value fall through to the compiled runtime default (input off, output on, cpal-picked devices). Pass torun_withwhen you want to override.
Traits§
- Plugin
Export - Unified export trait for all plugin formats.
Functions§
- is_
verbose - True when
--verbose/-v(orTRUCE_STANDALONE_VERBOSE=1) was passed at launch. Errors and--list-*output ignore this flag. - run
- Run the plugin standalone with no plugin-author defaults. Argv, env, and the compiled runtime defaults are the only inputs. Dispatches to the windowed or headless runner; returns when the user closes the window or sends SIGINT.
- run_
with - Run the plugin standalone with the supplied launch defaults.
Argv and env still take precedence -
defaultsonly fills in values neither layer set. Same dispatch asrun.