Skip to main content

ferraus_core/
lib.rs

1//! # ferraus-core
2//!
3//! Shared foundation for every ferraus crate:
4//!
5//! * [`AudioBuffer`] — planar `f32` audio, the internal format of every stage.
6//! * [`units`] — the shared parser for `1.5s`, `-6dB`, `2kHz`, `C4`, `4:1`, `80%`, `1/16`.
7//! * [`op`] — [`OpSpec`]: the single definition of a command from which the CLI, `fx`
8//!   stages, pipelines, JSON Schemas, MCP tools, and docs are generated.
9//! * [`exec`] — the executor shared by the CLI, pipelines, and the MCP server.
10//! * [`envelope`] — the `--json` result envelope and provenance sidecars.
11//! * [`pipeline`] — pipeline files with content-hash stage caching.
12
13#![allow(clippy::type_complexity)]
14
15pub mod buffer;
16pub mod builtin;
17pub mod ctx;
18pub mod envelope;
19pub mod error;
20pub mod exec;
21pub mod op;
22pub mod paths;
23pub mod pipeline;
24pub mod registry;
25pub mod resample;
26pub mod schema;
27pub mod testing;
28pub mod units;
29pub mod wav;
30
31pub use buffer::{db_to_lin, lin_to_db, AudioBuffer, MediaBuffer};
32pub use ctx::{AudioIo, AudioReader, AudioWriter, EncodeOptions, Globals, OpCtx, Progress, SourceInfo};
33pub use envelope::{Envelope, Sidecar, FERRAUS_VERSION, SCHEMA_VERSION};
34pub use error::{Error, ErrorKind, Result};
35pub use op::{param, Args, Category, InputKind, Inputs, OpSpec, ParamKind, ParamSpec, Runner};
36pub use registry::Registry;
37
38/// Everything an op-defining crate usually needs.
39pub mod prelude {
40    pub use crate::buffer::{db_to_lin, lin_to_db, AudioBuffer};
41    pub use crate::ctx::OpCtx;
42    pub use crate::error::{Error, ErrorKind, Result};
43    pub use crate::op::{param, Args, Category, InputKind, Inputs, OpSpec, ParamKind};
44    pub use crate::units;
45    pub use serde_json::{json, Value};
46}