Skip to main content

autoeq_plot/
config.rs

1//! Plotting configuration decoupled from CLI arguments.
2
3/// Domain configuration for plot generation.
4#[derive(Debug, Clone)]
5pub struct PlotConfig {
6    pub speaker_name: Option<String>,
7    pub num_filters: usize,
8    pub sample_rate: f64,
9    pub peq_model: crate::PeqModel,
10    pub min_freq: f64,
11    pub max_freq: f64,
12}
13
14impl From<&crate::cli::Args> for PlotConfig {
15    fn from(args: &crate::cli::Args) -> Self {
16        Self {
17            speaker_name: args.speaker.clone(),
18            num_filters: args.num_filters,
19            sample_rate: args.sample_rate,
20            peq_model: args.effective_peq_model(),
21            min_freq: args.min_freq,
22            max_freq: args.max_freq,
23        }
24    }
25}