use crate::dialect::Dialect;
#[allow(unused_imports)]
use super::{
commands::{Addr, Value},
AddrEncoding, FixedPoint, FloatEncoding,
Source::{self as Source, *},
};
mod probe;
pub use probe::{by_kind, probe, probe_kind, DeviceKind};
#[cfg(feature = "device_2x4hd")]
pub mod m2x4hd;
#[cfg(feature = "device_4x10hd")]
pub mod m4x10hd;
#[cfg(feature = "device_10x10hd")]
pub mod m10x10hd;
#[cfg(feature = "device_msharc4x8")]
pub mod msharc4x8;
#[cfg(feature = "device_shd")]
pub mod shd;
#[cfg(feature = "device_ddrc24")]
pub mod ddrc24;
#[cfg(feature = "device_ddrc88bm")]
pub mod ddrc88bm;
#[cfg(feature = "device_nanodigi2x8")]
pub mod nanodigi2x8;
#[cfg(feature = "device_c8x12v2")]
pub mod c8x12v2;
#[cfg(feature = "device_m2x4")]
pub mod m2x4;
pub static GENERIC: Device = Device {
product_name: "Generic",
sources: &[],
inputs: &[],
outputs: &[],
fir_max_taps: 0,
internal_sampling_rate: 0,
#[cfg(feature = "symbols")]
symbols: &[],
dialect: Dialect::const_default(),
};
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Device {
pub product_name: &'static str,
pub sources: &'static [Source],
pub inputs: &'static [Input],
pub outputs: &'static [Output],
pub fir_max_taps: u16,
pub internal_sampling_rate: u32,
pub dialect: Dialect,
#[cfg(feature = "symbols")]
pub symbols: &'static [(&'static str, u16)],
}
impl Default for Device {
fn default() -> Self {
Self {
product_name: Default::default(),
sources: Default::default(),
inputs: Default::default(),
outputs: Default::default(),
fir_max_taps: Default::default(),
internal_sampling_rate: Default::default(),
#[cfg(feature = "symbols")]
symbols: Default::default(),
dialect: Dialect::const_default(),
}
}
}
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Input {
pub gate: Option<Gate>,
pub meter: Option<u16>,
pub peq: &'static [u16],
pub routing: &'static [Gate],
}
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Output {
pub gate: Gate,
pub meter: Option<u16>,
pub delay_addr: Option<u16>,
pub invert_addr: u16,
pub peq: &'static [u16],
pub xover: Option<Crossover>,
pub compressor: Option<Compressor>,
pub fir: Option<Fir>,
}
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Gate {
pub enable: u16,
pub gain: Option<u16>,
}
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Compressor {
pub bypass: u16,
pub threshold: u16,
pub ratio: u16,
pub attack: u16,
pub release: u16,
pub meter: Option<u16>,
}
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Crossover {
pub peqs: &'static [u16],
}
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct Fir {
pub index: u8,
pub num_coefficients: u16,
pub bypass: u16,
pub max_coefficients: u16,
}