mod dinf;
mod hmhd;
mod nmhd;
mod smhd;
mod stbl;
mod sthd;
mod vmhd;

pub use dinf::*;
pub use hmhd::*;
pub use nmhd::*;
pub use smhd::*;
pub use stbl::*;
pub use sthd::*;
pub use vmhd::*;

use crate::*;

#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Minf {
    pub vmhd: Option<Vmhd>,
    pub smhd: Option<Smhd>,
    pub nmhd: Option<Nmhd>,
    pub sthd: Option<Sthd>,
    pub hmhd: Option<Hmhd>,
    pub dinf: Dinf,
    pub stbl: Stbl,
}

impl Atom for Minf {
    const KIND: FourCC = FourCC::new(b"minf");

    nested! {
        required: [ Dinf, Stbl ],
        optional: [ Vmhd, Smhd, Nmhd, Sthd, Hmhd ],
        multiple: [],
    }
}
