roomeq-model 0.5.5

RoomEQ configuration, pipeline, and DSP-chain contracts
Documentation
use super::default::default_auto_max_filters;
use super::default::default_auto_min_filters;
use super::default::default_true;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

/// Opt-in automatic room EQ optimizer bound selection.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct AutoOptimizerConfig {
    /// Enable automatic selection for the fields below.
    #[serde(default)]
    pub enabled: bool,
    /// Automatically choose the maximum PEQ filter count.
    #[serde(default = "default_true")]
    pub filter_count: bool,
    /// Automatically choose Q bounds.
    #[serde(default = "default_true")]
    pub q_bounds: bool,
    /// Automatically choose gain bounds and boost envelopes.
    #[serde(default = "default_true")]
    pub gain_bounds: bool,
    /// Minimum filter count when automatic count selection is enabled.
    #[serde(default = "default_auto_min_filters")]
    pub min_filters: usize,
    /// Maximum filter count when automatic count selection is enabled.
    #[serde(default = "default_auto_max_filters")]
    pub max_filters: usize,
}

impl Default for AutoOptimizerConfig {
    fn default() -> Self {
        Self {
            enabled: false,
            filter_count: true,
            q_bounds: true,
            gain_bounds: true,
            min_filters: default_auto_min_filters(),
            max_filters: default_auto_max_filters(),
        }
    }
}