Description
Similar to Picture
, once chapters are supported in ID3v2 (#189), EBML, Vorbis Comments, and MP4, it may be worth creating a generic representation of chapters that can be converted to and from the concrete implementations.
Not yet sure if this would be easy (or possible) to accomplish, since there's a pretty big difference in available information between the formats.
The basic idea would be:
pub struct Chapter {
pub name: String,
pub start_time: u32,
pub end_time: u32,
}
This seems to cover the bare minimum required information for chapters in all formats (It could be expanded with additional optional information).
However, with MP4 (at least in one of many chapter formats available) and Vorbis Comments, there is only a name and start time available. end_time
may need to be optional, making the conversion between Chapter
and the ID3v2/EBML chapters fallible.