1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Plugin setup types for declaring host information requirements.
//!
//! Use these types with [`Descriptor::Setup`](crate::Descriptor::Setup) to specify what
//! information your plugin needs from the host during preparation.
//!
//! # Quick Reference
//!
//! | Type | Value | Use Case |
//! |------|-------|----------|
//! | `()` | - | Stateless plugins (gain, pan) |
//! | [`SampleRate`] | `f64` | Time-based DSP (delay, filter, envelope) |
//! | [`MaxBufferSize`] | `usize` | FFT, lookahead buffers |
//! | [`MainInputChannels`] | `u32` | Per-channel input processing |
//! | [`MainOutputChannels`] | `u32` | Per-channel output state |
//! | [`AuxInputCount`] | `usize` | Sidechain-aware processing |
//! | [`AuxOutputCount`] | `usize` | Multi-bus output |
//! | [`ProcessMode`] | enum | Quality settings for offline rendering |
//!
//! # Combining Types
//!
//! Request multiple values using tuples:
//!
//! ```ignore
//! type Setup = (SampleRate, MaxBufferSize);
//! type Setup = (SampleRate, MainOutputChannels);
//! type Setup = (SampleRate, MaxBufferSize, ProcessMode);
//! ```
//!
//! # Examples
//!
//! ```ignore
//! use beamer::setup::*;
//!
//! // Stateless plugin (gain, pan)
//! impl Descriptor for Gain {
//! type Setup = ();
//! fn prepare(self, _: ()) -> Self { self }
//! }
//!
//! // Time-based DSP (delay, filter, envelope, smoothing)
//! impl Descriptor for Delay {
//! type Setup = SampleRate;
//! fn prepare(self, sample_rate: SampleRate) -> DelayProcessor {
//! let buffer_size = (2.0 * sample_rate.hz()) as usize;
//! DelayProcessor { buffer: vec![0.0; buffer_size], /* ... */ }
//! }
//! }
//!
//! // FFT or lookahead processing
//! impl Descriptor for Fft {
//! type Setup = (SampleRate, MaxBufferSize);
//! fn prepare(self, (sr, mbs): (SampleRate, MaxBufferSize)) -> FftProcessor {
//! FftProcessor { fft_buffer: vec![0.0; mbs.0], /* ... */ }
//! }
//! }
//! ```
pub use crate;