//! Configuration module for the record daemon.
//!
//! This module handles user-configurable settings, encoding presets,
//! and configuration file persistence.

mod persistence;
mod presets;
mod settings;

pub use persistence::{load_config, save_config, ConfigPersistence};
pub use presets::{AmfQuality, AudioSettings, EncoderPreset, QualityLevel};
pub use settings::{OutputSettings, Settings, VideoSettings};

use std::path::PathBuf;

/// Default configuration file name.
pub const CONFIG_FILE_NAME: &str = "config.toml";

/// Get the default configuration directory.
pub fn get_config_dir() -> Option<PathBuf> {
    directories::ProjectDirs::from("com", "leaguerecorder", "record-daemon")
        .map(|dirs| dirs.config_dir().to_path_buf())
}

/// Get the default output directory for recordings.
pub fn get_default_output_dir() -> Option<PathBuf> {
    directories::ProjectDirs::from("com", "leaguerecorder", "record-daemon")
        .map(|dirs| dirs.data_dir().join("recordings"))
}
