#![allow(unused)]
use {
super::super::{add_one_get, fake_rng},
fake::{Dummy, Fake, Faker},
serde::{Deserialize, Serialize},
};
use super::{
audio::Audio, clip_slot::ClipSlot, clips::Clips, markers::Markers, notes::Notes,
points::Points, time_unit::TimeUnit, timeline::TimeLine, video::Video, warps::Warps,
};
#[derive(Debug, Deserialize, Serialize, Clone, Dummy)]
pub enum ArrangementTypeChoiceEnum {
Timeline(TimeLine),
Lanes(Lanes),
Notes(Notes),
Clips(Clips),
ClipSlot(ClipSlot),
Markers(Markers),
Warps(Warps),
Audio(Audio),
Video(Video),
Points(Points),
}
#[derive(Debug, Deserialize, Serialize, Clone, Dummy)]
pub struct LanesSequence {
#[serde(rename = "$value", default)]
pub lanes_sequence: Option<LanesSequenceChoice>,
}
impl LanesSequence {
pub fn new() -> Self {
Self {
lanes_sequence: Some(vec![]),
}
}
pub fn new_fake() -> Self {
let o: Self = Faker.fake_with_rng(&mut fake_rng());
o
}
}
type LanesSequenceChoice = Vec<ArrangementTypeChoiceEnum>;
#[derive(Debug, Deserialize, Serialize, Clone, Dummy)]
pub struct Lanes {
#[serde(rename = "@id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "@name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "@color")]
#[serde(skip_serializing_if = "Option::is_none")]
pub color: Option<String>,
#[serde(rename = "@comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "@track")]
#[serde(skip_serializing_if = "Option::is_none")]
pub track: Option<String>,
#[serde(rename = "@timeUnit")]
#[serde(skip_serializing_if = "Option::is_none", default)]
pub time_unit: Option<TimeUnit>,
#[serde(rename = "$value", default)]
pub lanes_sequence: Option<LanesSequenceChoice>,
}
impl Lanes {
pub fn new_test() -> Self {
Self {
id: Some(format!("id{}", add_one_get())),
name: None,
color: None,
comment: None,
track: None,
time_unit: None,
lanes_sequence: Some(vec![]),
}
}
pub fn new_fake() -> Self {
let o: Self = Faker.fake_with_rng(&mut fake_rng());
o
}
}
#[cfg(test)]
mod tests {
use {super::Lanes, quick_xml::se::to_string, std::error::Error};
#[test]
pub fn se_test() -> Result<(), Box<dyn Error>> {
let mut o = Lanes::new_fake();
match to_string(&o) {
Ok(o) => println!("{}", o),
Err(err) => return Err(err.into()),
}
Ok(())
}
}