pub mod profiles;
// On migrera les fichiers mp3.rs, aac.rs, etc. ici en Phase 2.
// Pour l'instant, on définit les enums de base ici.

use serde::{Deserialize, Serialize};
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum AudioCodec {
    MP3,
    AAC,
    OPUS,
    FLAC,
    WAV, // PCM
}

impl fmt::Display for AudioCodec {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            AudioCodec::MP3 => write!(f, "libmp3lame"),
            AudioCodec::AAC => write!(f, "aac"),
            AudioCodec::OPUS => write!(f, "libopus"),
            AudioCodec::FLAC => write!(f, "flac"),
            AudioCodec::WAV => write!(f, "pcm_s16le"),
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ContainerFormat {
    MP3,
    MP4,
    OGG,
    FLAC,
    WAV,
    HLS, // m3u8 + segments
}

impl fmt::Display for ContainerFormat {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            ContainerFormat::MP3 => write!(f, "mp3"),
            ContainerFormat::MP4 => write!(f, "mp4"),
            ContainerFormat::OGG => write!(f, "ogg"),
            ContainerFormat::FLAC => write!(f, "flac"),
            ContainerFormat::WAV => write!(f, "wav"),
            ContainerFormat::HLS => write!(f, "hls"),
        }
    }
}
