roomeq-model 0.5.5

RoomEQ configuration, pipeline, and DSP-chain contracts
Documentation
use super::default::default_direct_window_ms;
use super::default::default_early_cue_risk_db;
use super::default::default_early_window_ms;
use super::default::default_late_window_ms;
use super::default::default_true;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

/// Direct/early/late impulse-response reporting windows for FIR and
/// mixed-phase modes.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)]
pub struct EarlyLateCorrectionConfig {
    /// Enable direct/early/late correction-energy reporting.
    #[serde(default = "default_true")]
    pub enabled: bool,
    /// End of the direct-sound window in milliseconds.
    #[serde(default = "default_direct_window_ms")]
    pub direct_window_ms: f64,
    /// End of the direct-plus-early window in milliseconds.
    #[serde(default = "default_early_window_ms")]
    pub early_window_ms: f64,
    /// End of the late-reflection summary window in milliseconds.
    #[serde(default = "default_late_window_ms")]
    pub late_window_ms: f64,
    /// Advisory threshold for direct/early correction energy.
    #[serde(default = "default_early_cue_risk_db")]
    pub early_cue_risk_db: f64,
}

impl Default for EarlyLateCorrectionConfig {
    fn default() -> Self {
        Self {
            enabled: true,
            direct_window_ms: default_direct_window_ms(),
            early_window_ms: default_early_window_ms(),
            late_window_ms: default_late_window_ms(),
            early_cue_risk_db: default_early_cue_risk_db(),
        }
    }
}