minidsp_protocol/device/
mod.rs1use crate::dialect::Dialect;
6
7#[allow(unused_imports)]
8use super::{
9 commands::{Addr, Value},
10 AddrEncoding, FixedPoint, FloatEncoding,
11 Source::{self as Source, *},
12};
13
14mod probe;
15pub use probe::{by_kind, probe, probe_kind, DeviceKind};
16
17#[cfg(feature = "device_2x4hd")]
18pub mod m2x4hd;
19
20#[cfg(feature = "device_4x10hd")]
21pub mod m4x10hd;
22
23#[cfg(feature = "device_10x10hd")]
24pub mod m10x10hd;
25
26#[cfg(feature = "device_msharc4x8")]
27pub mod msharc4x8;
28
29#[cfg(feature = "device_shd")]
30pub mod shd;
31
32#[cfg(feature = "device_ddrc24")]
33pub mod ddrc24;
34
35#[cfg(feature = "device_ddrc88bm")]
36pub mod ddrc88bm;
37
38#[cfg(feature = "device_nanodigi2x8")]
39pub mod nanodigi2x8;
40
41#[cfg(feature = "device_c8x12v2")]
42pub mod c8x12v2;
43
44#[cfg(feature = "device_m2x4")]
45pub mod m2x4;
46
47pub static GENERIC: Device = Device {
48 product_name: "Generic",
49 sources: &[],
50 inputs: &[],
51 outputs: &[],
52 fir_max_taps: 0,
53 internal_sampling_rate: 0,
54 #[cfg(feature = "symbols")]
55 symbols: &[],
56 dialect: Dialect::const_default(),
57};
58
59#[cfg_attr(feature = "debug", derive(Debug))]
61pub struct Device {
62 pub product_name: &'static str,
64 pub sources: &'static [Source],
66 pub inputs: &'static [Input],
68 pub outputs: &'static [Output],
70 pub fir_max_taps: u16,
72 pub internal_sampling_rate: u32,
74 pub dialect: Dialect,
76 #[cfg(feature = "symbols")]
78 pub symbols: &'static [(&'static str, u16)],
79}
80
81impl Default for Device {
82 fn default() -> Self {
83 Self {
84 product_name: Default::default(),
85 sources: Default::default(),
86 inputs: Default::default(),
87 outputs: Default::default(),
88 fir_max_taps: Default::default(),
89 internal_sampling_rate: Default::default(),
90 #[cfg(feature = "symbols")]
91 symbols: Default::default(),
92 dialect: Dialect::const_default(),
93 }
94 }
95}
96
97#[cfg_attr(feature = "debug", derive(Debug))]
99pub struct Input {
100 pub gate: Option<Gate>,
102 pub meter: Option<u16>,
104 pub peq: &'static [u16],
106 pub routing: &'static [Gate],
108}
109
110#[cfg_attr(feature = "debug", derive(Debug))]
112pub struct Output {
113 pub gate: Gate,
115 pub meter: Option<u16>,
117 pub delay_addr: Option<u16>,
119 pub invert_addr: u16,
121 pub peq: &'static [u16],
123 pub xover: Option<Crossover>,
125 pub compressor: Option<Compressor>,
127 pub fir: Option<Fir>,
129}
130
131#[cfg_attr(feature = "debug", derive(Debug))]
133pub struct Gate {
134 pub enable: u16,
136
137 pub gain: Option<u16>,
139}
140#[cfg_attr(feature = "debug", derive(Debug))]
141pub struct Compressor {
142 pub bypass: u16,
143 pub threshold: u16,
144 pub ratio: u16,
145 pub attack: u16,
146 pub release: u16,
147 pub meter: Option<u16>,
148}
149
150#[cfg_attr(feature = "debug", derive(Debug))]
151pub struct Crossover {
152 pub peqs: &'static [u16],
154}
155
156#[cfg_attr(feature = "debug", derive(Debug))]
157pub struct Fir {
158 pub index: u8,
160
161 pub num_coefficients: u16,
163
164 pub bypass: u16,
166
167 pub max_coefficients: u16,
169}