use compact_str::CompactString;
use serde::{
Deserialize,
Serialize,
};
use serde_with::skip_serializing_none;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct LyricWordBase {
pub start_time: u32,
pub end_time: u32,
pub word: CompactString,
}
#[skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AmllLyricWord {
pub start_time: u32,
pub end_time: u32,
pub word: CompactString,
pub roman_word: Option<CompactString>,
pub obscene: Option<bool>,
pub empty_beat: Option<u32>,
pub ruby: Option<Vec<LyricWordBase>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AmllLyricLine {
pub words: Vec<AmllLyricWord>,
pub translated_lyric: String,
pub roman_lyric: String,
#[serde(rename = "isBG")]
pub is_bg: bool,
pub is_duet: bool,
pub start_time: u32,
pub end_time: u32,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
pub struct AmllMetadata {
pub key: CompactString,
pub value: Vec<CompactString>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AmllLyricResult {
#[serde(rename = "lyricLines")]
pub lines: Vec<AmllLyricLine>,
pub metadata: Vec<AmllMetadata>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase", default)]
pub struct TtmlToAmllOptions {
pub translation_language: Option<String>,
pub romanization_language: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase", default)]
pub struct AmllToTtmlOptions {
pub translation_language: Option<String>,
pub romanization_language: Option<String>,
}