Expand description
User-facing plugin traits + internal bridge.
This crate is the plugin author’s entry point. The single
impl PluginLogic for MyPlugin { ... } block covers both
audio-thread DSP and main-thread GUI, with sample precision
routed through the prelude (see truce::prelude /
truce::prelude64).
truce-plugin depends on truce-gui-types (light: layout,
render trait, widget regions) - not the full truce-gui.
Plugin authors who supply a custom editor (egui, iced, slint,
raw window handle) end up with truce-plugin in their dep
tree but not the built-in editor’s tiny-skia + baseview +
truce-font stack.
§Three traits, one source of truth
PluginLogic- what plugin authors implement forf32-buffer plugins.PluginLogic64- what plugin authors implement forf64-buffer plugins.PluginLogicCore- generic-over-Strait the format wrappers consume.
The two leaf traits are stamped from one
plugin_logic_leaf_trait! macro_rules! definition (further
down this file) so their method surfaces stay in lock-step. Each leaf
gets a blanket impl that forwards every method to
PluginLogicCore<S> with the matching S. Wrappers
(StaticShell, HotShell, the format crates) bind on
PluginLogicCore<S> and don’t care which leaf the user impl’d.
§What this buys
Plugin authors writing impl PluginLogic for Synth { ... }
never name a precision. The truce::prelude64 re-export aliases
PluginLogic64 as PluginLogic in the user’s scope, so the
same impl header reads the same regardless of which prelude is
in use. The <S> token that used to live on the impl header is
gone - the prelude carries the precision choice.
Traits§
- Plugin
Logic - The
f32-buffer user-facing plugin trait. - Plugin
Logic64 - The
f64-buffer user-facing plugin trait. Same surface asPluginLogicbut with the audio buffer pinned tof64. - Plugin
Logic Core - Wrapper-facing plugin trait, generic over the audio sample type.
Functions§
- default_
hit_ test - Default hit test: circular for knobs, rectangular for everything
else, skip meters. Used by the leaf traits’
hit_testdefaults.