#![forbid(unsafe_code)]
pub use truce_core as core;
pub use truce_derive::{ParamEnum, Params, State};
pub use truce_gui as gui;
pub use truce_params as params;
#[cfg(feature = "clap")]
pub use truce_clap as clap_wrapper;
#[cfg(feature = "vst3")]
pub use truce_vst3 as vst3_wrapper;
mod plugin_macro;
#[doc(hidden)]
pub mod __reexport {
pub use truce_derive::__truce_lv2_emit_root;
pub use truce_loader::{export_plugin, export_static};
#[cfg(feature = "shell")]
pub use truce_loader::shell::HotShell;
#[cfg(feature = "shell")]
#[must_use]
pub fn shell_sidecar_path(crate_name: &str) -> Option<std::path::PathBuf> {
truce_core::shell_sidecar::sidecar_path(crate_name)
}
}
mod prelude_impl {
pub use std::f64::consts::TAU;
pub use std::sync::Arc;
pub use truce_core::custom_state::{State as StateTrait, StateBinding, StateField};
pub use truce_core::sample::{Float, Sample as SampleTrait};
pub use truce_core::state::StateLoadError;
pub use truce_core::util::{db_to_linear, linear_to_db, meter_display, midi_note_to_freq};
pub use truce_core::{
BusConfig, BusKind, BusLayout, ChannelConfig, Editor, Event, EventBody, EventList, Plugin,
PluginCategory, PluginContext, PluginExport, PluginInfo, ProcessContext, ProcessStatus,
TransportInfo,
};
pub use truce_derive::{ParamEnum, Params, State, plugin_info};
pub use truce_gui::interaction::WidgetRegion;
pub use truce_gui::render::RenderBackend;
pub use truce_gui::theme::{Color, Theme};
pub use truce_params::{
BoolParam, EnumParam, FloatParam, IntParam, MeterSlot, ParamEnum, ParamFlags, ParamInfo,
ParamRange, ParamUnit, Params, Smoother, SmoothingStyle,
};
}
macro_rules! define_prelude {
(
$(#[$attr:meta])*
$name:ident, sample = $sample:ty, leaf = $leaf:ident,
float_read = $float_read:ident, ctx_read = $ctx_read:ident
) => {
$(#[$attr])*
pub mod $name {
pub use super::prelude_impl::*;
pub use truce_core::editor::$ctx_read as _;
pub use truce_gui::$leaf as PluginLogic;
pub use truce_params::$float_read as _;
pub type Sample = $sample;
pub type AudioBuffer<'a, S = Sample> = truce_core::buffer::AudioBuffer<'a, S>;
}
};
}
define_prelude! {
prelude, sample = f32, leaf = PluginLogic,
float_read = FloatParamReadF32, ctx_read = PluginContextReadF32
}
define_prelude! {
prelude32, sample = f32, leaf = PluginLogic,
float_read = FloatParamReadF32, ctx_read = PluginContextReadF32
}
define_prelude! {
prelude64, sample = f64, leaf = PluginLogic64,
float_read = FloatParamReadF64, ctx_read = PluginContextReadF64
}
define_prelude! {
prelude64m, sample = f32, leaf = PluginLogic,
float_read = FloatParamReadF64, ctx_read = PluginContextReadF64
}