Removed Cue.ident field from interface

This commit is contained in:
Jamie Hardt
2021-01-03 11:27:49 -08:00
parent e941358c8d
commit 0a307fbf05
2 changed files with 11 additions and 5 deletions

View File

@@ -20,6 +20,15 @@ struct RawCue {
} }
impl RawCue { impl RawCue {
fn write_to(cues : Vec<Self>) -> Vec<u8> {
let mut writer = Cursor::new(vec![0u8; 0]);
todo!()
}
fn read_from(data : &[u8]) -> Result<Vec<Self>,Error> { fn read_from(data : &[u8]) -> Result<Vec<Self>,Error> {
let mut rdr = Cursor::new(data); let mut rdr = Cursor::new(data);
let count = rdr.read_u32::<LittleEndian>()?; let count = rdr.read_u32::<LittleEndian>()?;
@@ -198,7 +207,7 @@ impl AdtlMemberSearch for Vec<RawAdtlMember> {
pub struct Cue { pub struct Cue {
/// Unique numeric identifier for this cue /// Unique numeric identifier for this cue
pub ident : u32, //pub ident : u32,
/// The time of this marker /// The time of this marker
pub frame : u32, pub frame : u32,
@@ -236,7 +245,7 @@ impl Cue {
raw_cues.iter() raw_cues.iter()
.map(|i| { .map(|i| {
Cue { Cue {
ident : i.cue_point_id, //ident : i.cue_point_id,
frame : i.frame, frame : i.frame,
length: { length: {
raw_adtl.ltxt_for_cue_point(i.cue_point_id).first() raw_adtl.ltxt_for_cue_point(i.cue_point_id).first()

View File

@@ -320,19 +320,16 @@ impl<R: Read + Seek> WaveReader<R> {
/// let cue_points = f.cue_points().unwrap(); /// let cue_points = f.cue_points().unwrap();
/// ///
/// assert_eq!(cue_points.len(), 3); /// assert_eq!(cue_points.len(), 3);
/// assert_eq!(cue_points[0].ident, 1);
/// assert_eq!(cue_points[0].frame, 12532); /// assert_eq!(cue_points[0].frame, 12532);
/// assert_eq!(cue_points[0].length, None); /// assert_eq!(cue_points[0].length, None);
/// assert_eq!(cue_points[0].label, Some(String::from("Marker 1"))); /// assert_eq!(cue_points[0].label, Some(String::from("Marker 1")));
/// assert_eq!(cue_points[0].note, Some(String::from("Marker 1 Comment"))); /// assert_eq!(cue_points[0].note, Some(String::from("Marker 1 Comment")));
/// ///
/// assert_eq!(cue_points[1].ident, 2);
/// assert_eq!(cue_points[1].frame, 20997); /// assert_eq!(cue_points[1].frame, 20997);
/// assert_eq!(cue_points[1].length, None); /// assert_eq!(cue_points[1].length, None);
/// assert_eq!(cue_points[1].label, Some(String::from("Marker 2"))); /// assert_eq!(cue_points[1].label, Some(String::from("Marker 2")));
/// assert_eq!(cue_points[1].note, Some(String::from("Marker 2 Comment"))); /// assert_eq!(cue_points[1].note, Some(String::from("Marker 2 Comment")));
/// ///
/// assert_eq!(cue_points[2].ident, 3);
/// assert_eq!(cue_points[2].frame, 26711); /// assert_eq!(cue_points[2].frame, 26711);
/// assert_eq!(cue_points[2].length, Some(6465)); /// assert_eq!(cue_points[2].length, Some(6465));
/// assert_eq!(cue_points[2].label, Some(String::from("Timed Region"))); /// assert_eq!(cue_points[2].label, Some(String::from("Timed Region")));