Encode first sector

This commit is contained in:
2022-10-19 19:44:52 +02:00
parent 55673b3afe
commit 97c4f0a05d
7 changed files with 73 additions and 9 deletions

View File

@@ -115,4 +115,14 @@ impl Sector {
Sector::CDXAAudio(_) => ()
}
}
pub fn finalize(&mut self) {
match self {
Sector::Audio(_) => (),
Sector::Empty(_) => (),
Sector::CDData(sector) => sector.finalize(),
Sector::CDXAData(sector) => sector.finalize(),
Sector::CDXAAudio(sector) => sector.finalize(),
}
}
}

View File

@@ -80,6 +80,10 @@ impl Header {
self.sector = sector;
}
pub fn get_time(&self) -> Time {
Time::from((self.minute.clone(), self.second.clone(), self.sector.clone()))
}
pub fn get_mode(&self) -> Result<HeaderMode, u8> {
match self.mode {
0 => Ok(HeaderMode::Mode0),