Skip to main content

aura/
lib.rs

1//! **AURA** — Audio Unified Rust Architecture.
2//!
3//! Umbrella crate for plugin authors. Prefer this over depending on
4//! every `aura-*` piece individually:
5//!
6//! ```toml
7//! lx-aura = { path = ".../AURA/crates/aura", features = ["clap"] }
8//! # optional UI:
9//! lx-aura-baseview = { path = "...", features = ["backend-femtovg"] }
10//! lx-aura-editor = { path = "...", features = ["backend-femtovg"] }
11//! ```
12//!
13//! ```rust,ignore
14//! use aura::prelude::*;
15//! ```
16//!
17//! Package name is `lx-aura`; the Rust crate stays `aura` (`[lib] name`).
18//! Features: `clap` / `vst3` / `lv2` for formats; `dsp` (default) for
19//! `lx-aura-dsp`. Params-only plugins: `default-features = false`.
20//!
21//! `#[derive(Params)]` requires this umbrella (or an equivalent
22//! `aura_params` + path setup) — generated code uses `::aura::params::…`.
23
24#![forbid(unsafe_code)]
25
26pub use aura_core as core;
27pub use aura_midi as midi;
28pub use aura_params as params;
29
30#[cfg(feature = "dsp")]
31pub use aura_dsp as dsp;
32
33#[cfg(feature = "clap")]
34pub use aura_clap as clap;
35
36#[cfg(feature = "vst3")]
37pub use aura_vst3 as vst3;
38
39#[cfg(feature = "lv2")]
40pub use aura_lv2 as lv2;
41
42// --- core surface ---
43pub use aura_core::{
44    AudioBuffer, AudioConfig, BusLayout, ChannelConfig, Editor, EditorBridge, FactoryPreset,
45    FactoryPresetState, IntoEditor, MidiBuffer, MidiDialect, MidiEvent, MidiMessage, MidiStatus,
46    NOTE_UNSPECIFIED, NoteBuffer, NoteEvent, NoteEventKind, NoteExpression, NoteNameEntry,
47    NoteTarget, NoteVoice, NoteVoiceTable, ParamEvent, ParamEventQueue, PluginCategory,
48    PluginContext, PluginInfo, PluginLogic, ProcessContext, ProcessMode, ProcessStatus,
49    RawWindowHandle, Transport, Tuning, TuningEvent, TuningInfo, Ump, UmpBuffer, UmpEvent,
50    append_midi_as_notes, append_midi_as_ump, append_notes_as_midi, append_ump_as_midi,
51    apply_factory_preset, decode_state, encode_state, layout_at, load_preset_file,
52    note_split_points, note_split_points_into, notes_or_midi,
53};
54
55// --- params surface ---
56pub use aura_params::sample::{Float, Sample};
57pub use aura_params::{
58    AudioTap, BoolParam, EnumParam, FloatParam, FloatParamReadF32, FloatParamReadF64, IntParam,
59    MeterSlot, MidiSource, ParamEnum, ParamFlags, ParamInfo, ParamRange, ParamUnit, ParamValueKind,
60    Params, Smoother, SmoothingStyle, format_param_value, parse_param_value,
61};
62
63pub use aura_derive::{ParamEnum, Params};
64
65#[cfg(feature = "clap")]
66pub use aura_clap::export;
67
68#[cfg(feature = "clap")]
69pub use aura_clap::export_clap;
70
71#[cfg(feature = "vst3")]
72pub use aura_vst3::export_vst3;
73
74#[cfg(feature = "lv2")]
75pub use aura_lv2::export_lv2;
76
77/// Common imports for plugin authors.
78///
79/// Niche helpers (`AudioTap`, `MeterSlot`, voice table) stay here so smokes
80/// and instruments share one import line. Prefer `aura::encode_state` at the
81/// crate root when you only need the codec.
82pub mod prelude {
83    pub use std::sync::Arc;
84
85    pub use crate::{
86        AudioBuffer, AudioConfig, AudioTap, BoolParam, BusLayout, ChannelConfig, Editor, EnumParam,
87        FactoryPreset, FactoryPresetState, FloatParam, FloatParamReadF32, IntParam, IntoEditor,
88        MeterSlot, MidiBuffer, MidiDialect, MidiMessage, NoteBuffer, NoteEvent, NoteEventKind,
89        NoteExpression, NoteNameEntry, NoteTarget, NoteVoice, NoteVoiceTable, ParamEnum,
90        ParamFlags, ParamInfo, ParamRange, ParamUnit, ParamValueKind, Params, PluginCategory,
91        PluginContext, PluginInfo, PluginLogic, ProcessContext, ProcessMode, ProcessStatus,
92        RawWindowHandle, SmoothingStyle, Transport, Ump, UmpBuffer, append_midi_as_notes,
93        decode_state, encode_state, layout_at, note_split_points, note_split_points_into,
94        notes_or_midi,
95    };
96    // FloatParamReadF64: same method names as F32 → E0034 if both in prelude.
97    // Use `aura::FloatParamReadF64` explicitly.
98    pub use crate::params::sample::Float;
99}