use std::io;
use bytes::Bytes;
use enhanced::ExAudioTagBody;
use legacy::LegacyAudioTagBody;
use super::header::AudioTagHeader;
pub mod enhanced;
pub mod legacy;
#[derive(Debug, Clone, PartialEq)]
pub enum AudioTagBody {
Legacy(LegacyAudioTagBody),
Enhanced(ExAudioTagBody),
}
impl AudioTagBody {
pub fn demux(header: &AudioTagHeader, reader: &mut io::Cursor<Bytes>) -> io::Result<Self> {
match header {
AudioTagHeader::Legacy(header) => LegacyAudioTagBody::demux(header, reader).map(Self::Legacy),
AudioTagHeader::Enhanced(header) => ExAudioTagBody::demux(header, reader).map(Self::Enhanced),
}
}
}