sim_lib_plugin_clap/lib.rs
1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Modeled CLAP-shaped plugin adapters for SIM audio graph processors.
4//!
5//! The default `model` feature is a pure-Rust, in-process model of the CLAP
6//! plugin format. The crate carries no `-sys` or FFI dependency:
7//! [`ClapHostProcessor`] runs SIM audio-graph processors shaped to the CLAP
8//! descriptor, and `export_*_as_clap` produces descriptors, not native binaries.
9//! The optional `clap-host` feature exposes a provider trait and fixture host
10//! provider for capability-gated fallback loading without adding an SDK binding.
11//!
12//! ```rust
13//! use sim_lib_plugin_clap::clap_gain_descriptor;
14//!
15//! let descriptor = clap_gain_descriptor().unwrap();
16//! assert_eq!(descriptor.id.format.as_str(), "clap");
17//! assert_eq!(descriptor.parameter(0).unwrap().stable_id.as_str(), "gain");
18//! ```
19
20mod adapter;
21pub mod cookbook;
22mod descriptor;
23mod event;
24#[cfg(feature = "clap-host")]
25pub mod native;
26mod runtime;
27
28pub use adapter::{
29 ClapExportedProcessor, ClapHostProcessor, export_gain_as_clap, export_processor_as_clap,
30};
31pub use cookbook::clap_gain_demo;
32pub use descriptor::{clap_audio_effect_descriptor, clap_gain_descriptor, clap_synth_descriptor};
33pub use event::{ClapEvent, ClapEventBuffer, ClapParamMap};
34pub use runtime::{ClapPluginLib, clap_plugin_symbols, install_clap_plugin_lib};
35
36/// Cookbook recipes for this lib, embedded at build time.
37pub static RECIPES: sim_cookbook::EmbeddedDir =
38 include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
39
40#[cfg(test)]
41mod tests;