use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpSavePlacedStructureDynamicSideBufferSampleEntry {
    pub sample_index: usize,
    pub name_tag_relative_offset: usize,
    pub prefix_leading_dword: u32,
    pub prefix_leading_dword_hex: String,
    pub prefix_trailing_word: u16,
    pub prefix_trailing_word_hex: String,
    pub prefix_separator_byte: u8,
    pub prefix_separator_byte_hex: String,
    #[serde(default)]
    pub primary_name: Option<String>,
    #[serde(default)]
    pub secondary_name: Option<String>,
    #[serde(default)]
    pub tertiary_name: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpSavePlacedStructureDynamicSideBufferPrefixPatternSummary {
    pub prefix_leading_dword: u32,
    pub prefix_leading_dword_hex: String,
    pub prefix_trailing_word: u16,
    pub prefix_trailing_word_hex: String,
    pub prefix_separator_byte: u8,
    pub prefix_separator_byte_hex: String,
    pub count: usize,
    pub first_name_tag_relative_offset: usize,
    pub prefix_leading_dword_matches_embedded_profile_tag: bool,
    pub section_like_primary_name_count: usize,
    pub cap_like_primary_name_count: usize,
    pub other_primary_name_count: usize,
    #[serde(default)]
    pub first_primary_name: Option<String>,
    #[serde(default)]
    pub first_secondary_name: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SmpSavePlacedStructureDynamicSideBufferNamePairSummary {
    pub primary_name: String,
    pub secondary_name: String,
    pub count: usize,
    pub first_name_tag_relative_offset: usize,
    pub unique_compact_prefix_pattern_count: usize,
    pub dominant_prefix_leading_dword: u32,
    pub dominant_prefix_leading_dword_hex: String,
    pub dominant_prefix_trailing_word: u16,
    pub dominant_prefix_trailing_word_hex: String,
    pub dominant_prefix_separator_byte: u8,
    pub dominant_prefix_separator_byte_hex: String,
    pub dominant_prefix_count: usize,
}
