use clap::ValueEnum;
#[derive(Clone, Debug, PartialEq)]
pub enum FrameGroup {
AttachedPicture,
AudioEncryption,
AudioSeekPointIndex,
Comments,
CommercialFrame,
EncryptionMethodRegistration,
Equalisation2,
EventTimingCodes,
GeneralEncapsulatedObject,
GroupIdentificationRegistration,
LinkedInformation,
MpegLocationLookupTable,
MusicCdIdentifier,
OwnershipFrame,
PlayCounter,
Popularimeter,
PositionSynchronisationFrame,
PrivateFrame,
RecommendedBufferSize,
RelativeVolumeAdjustment2,
Reverb,
SeekFrame,
SignatureFrame,
SynchronisedLyricsText,
SynchronisedTempoCodes,
TermsOfUseFrame,
TextInformationFrames,
UniqueFileIdentifier,
UnsynchronisedLyricsTextTranscription,
UrlLinkFrames,
}
#[derive(Clone, Debug, PartialEq, ValueEnum)]
pub enum FrameId {
Aenc,
Apic,
Aspi,
Comm,
Comr,
Encr,
Equ2,
Etco,
Geob,
Grid,
Link,
Mcdi,
Mllt,
Owne,
Priv,
Pcnt,
Popm,
Poss,
Rbuf,
Rva2,
Rvrb,
Seek,
Sign,
Sylt,
Sytc,
Talb,
Tbpm,
Tcom,
Tcon,
Tcop,
Tden,
Tdly,
Tdor,
Tdrc,
Tdrl,
Tdtg,
Tenc,
Text,
Tflt,
Tipl,
Tit1,
Tit2,
Tit3,
Tkey,
Tlan,
Tlen,
Tmcl,
Tmed,
Tmoo,
Toal,
Tofn,
Toly,
Tope,
Town,
Tpe1,
Tpe2,
Tpe3,
Tpe4,
Tpos,
Tpro,
Tpub,
Trck,
Trsn,
Trso,
Tsoa,
Tsop,
Tsot,
Tsrc,
Tsse,
Tsst,
Txxx,
Ufid,
User,
Uslt,
Wcom,
Wcop,
Woaf,
Woar,
Woas,
Wors,
Wpay,
Wpub,
Wxxx,
}
impl FrameGroup {
pub fn as_str(&self) -> &str {
match self {
Self::AttachedPicture => "Attached picture",
Self::AudioEncryption => "Audio encryption",
Self::AudioSeekPointIndex => "Audio seek point index",
Self::Comments => "Comments",
Self::CommercialFrame => "Commercial frame",
Self::EncryptionMethodRegistration => "Encryption method registration",
Self::Equalisation2 => "Equalisation (2)",
Self::EventTimingCodes => "Event timing codes",
Self::GeneralEncapsulatedObject => "General encapsulated object",
Self::GroupIdentificationRegistration => "Group identification registration",
Self::LinkedInformation => "Linked information",
Self::MpegLocationLookupTable => "MPEG location lookup table",
Self::MusicCdIdentifier => "Music CD identifier",
Self::OwnershipFrame => "Ownership frame",
Self::PlayCounter => "Play counter",
Self::Popularimeter => "Popularimeter",
Self::PositionSynchronisationFrame => "Position synchronisation frame",
Self::PrivateFrame => "Private frame",
Self::RecommendedBufferSize => "Recommended buffer size",
Self::RelativeVolumeAdjustment2 => "Relative volume adjustment (2)",
Self::Reverb => "Reverb",
Self::SeekFrame => "Seek frame",
Self::SignatureFrame => "Signature frame",
Self::SynchronisedLyricsText => "Synchronised lyrics/text",
Self::SynchronisedTempoCodes => "Synchronised tempo codes",
Self::TermsOfUseFrame => "Terms of use frame",
Self::TextInformationFrames => "Text information frames",
Self::UniqueFileIdentifier => "Unique file identifier",
Self::UnsynchronisedLyricsTextTranscription => {
"Unsynchronised lyrics/text transcription"
}
Self::UrlLinkFrames => "URL link frames",
}
}
}
impl FrameId {
pub fn name(&self) -> &str {
match self {
Self::Aenc => "Audio encryption",
Self::Apic => "Attached picture",
Self::Aspi => "Audio seek point index",
Self::Comm => "Comments",
Self::Comr => "Commercial frame",
Self::Encr => "Encryption method registration",
Self::Equ2 => "Equalisation (2)",
Self::Etco => "Event timing codes",
Self::Geob => "General encapsulated object",
Self::Grid => "Group identification registration",
Self::Link => "Linked information",
Self::Mcdi => "Music CD identifier",
Self::Mllt => "MPEG location lookup table",
Self::Owne => "Ownership frame",
Self::Priv => "Private frame",
Self::Pcnt => "Play counter",
Self::Popm => "Popularimeter",
Self::Poss => "Position synchronisation frame",
Self::Rbuf => "Recommended buffer size",
Self::Rva2 => "Relative volume adjustment (2)",
Self::Rvrb => "Reverb",
Self::Seek => "Seek frame",
Self::Sign => "Signature frame",
Self::Sylt => "Synchronised lyric/text",
Self::Sytc => "Synchronised tempo codes",
Self::Talb => "Album/Movie/Show title",
Self::Tbpm => "BPM (beats per minute)",
Self::Tcom => "Composer",
Self::Tcon => "Content type",
Self::Tcop => "Copyright message",
Self::Tden => "Encoding time",
Self::Tdly => "Playlist delay",
Self::Tdor => "Original release time",
Self::Tdrc => "Recording time",
Self::Tdrl => "Release time",
Self::Tdtg => "Tagging time",
Self::Tenc => "Encoded by",
Self::Text => "Lyricist/Text writer",
Self::Tflt => "File type",
Self::Tipl => "Involved people list",
Self::Tit1 => "Content group description",
Self::Tit2 => "Title/songname/content description",
Self::Tit3 => "Subtitle/Description refinement",
Self::Tkey => "Initial key",
Self::Tlan => "Language(s)",
Self::Tlen => "Length",
Self::Tmcl => "Musician credits list",
Self::Tmed => "Media type",
Self::Tmoo => "Mood",
Self::Toal => "Original album/movie/show title",
Self::Tofn => "Original filename",
Self::Toly => "Original lyricist(s)/text writer(s)",
Self::Tope => "Original artist(s)/performer(s)",
Self::Town => "File owner/licensee",
Self::Tpe1 => "Lead performer(s)/Soloist(s)",
Self::Tpe2 => "Band/orchestra/accompaniment",
Self::Tpe3 => "Conductor/performer refinement",
Self::Tpe4 => "Interpreted, remixed, or otherwise modified by",
Self::Tpos => "Part of a set",
Self::Tpro => "Produced notice",
Self::Tpub => "Publisher",
Self::Trck => "Track number/Position in set",
Self::Trsn => "Internet radio station name",
Self::Trso => "Internet radio station owner",
Self::Tsoa => "Album sort order",
Self::Tsop => "Performer sort order",
Self::Tsot => "Title sort order",
Self::Tsrc => "ISRC (international standard recording code)",
Self::Tsse => "Software/Hardware and settings used for encoding",
Self::Tsst => "Set subtitle",
Self::Txxx => "User defined text information frame",
Self::Ufid => "Unique file identifier",
Self::User => "Terms of use",
Self::Uslt => "Unsynchronised lyric/text transcription",
Self::Wcom => "Commercial information",
Self::Wcop => "Copyright/Legal information",
Self::Woaf => "Official audio file webpage",
Self::Woar => "Official artist/performer webpage",
Self::Woas => "Official audio source webpage",
Self::Wors => "Official Internet radio station homepage",
Self::Wpay => "Payment",
Self::Wpub => "Publishers official webpage",
Self::Wxxx => "User defined URL link frame",
}
}
pub fn as_frame_group(&self) -> FrameGroup {
match self {
Self::Aenc => FrameGroup::AudioEncryption,
Self::Apic => FrameGroup::AttachedPicture,
Self::Aspi => FrameGroup::AudioSeekPointIndex,
Self::Comm => FrameGroup::Comments,
Self::Comr => FrameGroup::CommercialFrame,
Self::Encr => FrameGroup::EncryptionMethodRegistration,
Self::Equ2 => FrameGroup::Equalisation2,
Self::Etco => FrameGroup::EventTimingCodes,
Self::Geob => FrameGroup::GeneralEncapsulatedObject,
Self::Grid => FrameGroup::GroupIdentificationRegistration,
Self::Link => FrameGroup::LinkedInformation,
Self::Mcdi => FrameGroup::MusicCdIdentifier,
Self::Mllt => FrameGroup::MpegLocationLookupTable,
Self::Owne => FrameGroup::OwnershipFrame,
Self::Priv => FrameGroup::PrivateFrame,
Self::Pcnt => FrameGroup::PlayCounter,
Self::Popm => FrameGroup::Popularimeter,
Self::Poss => FrameGroup::PositionSynchronisationFrame,
Self::Rbuf => FrameGroup::RecommendedBufferSize,
Self::Rva2 => FrameGroup::RelativeVolumeAdjustment2,
Self::Rvrb => FrameGroup::Reverb,
Self::Seek => FrameGroup::SeekFrame,
Self::Sign => FrameGroup::SignatureFrame,
Self::Sylt => FrameGroup::SynchronisedLyricsText,
Self::Sytc => FrameGroup::SynchronisedTempoCodes,
Self::Talb => FrameGroup::TextInformationFrames,
Self::Tbpm => FrameGroup::TextInformationFrames,
Self::Tcom => FrameGroup::TextInformationFrames,
Self::Tcon => FrameGroup::TextInformationFrames,
Self::Tcop => FrameGroup::TextInformationFrames,
Self::Tden => FrameGroup::TextInformationFrames,
Self::Tdly => FrameGroup::TextInformationFrames,
Self::Tdor => FrameGroup::TextInformationFrames,
Self::Tdrc => FrameGroup::TextInformationFrames,
Self::Tdrl => FrameGroup::TextInformationFrames,
Self::Tdtg => FrameGroup::TextInformationFrames,
Self::Tenc => FrameGroup::TextInformationFrames,
Self::Text => FrameGroup::TextInformationFrames,
Self::Tflt => FrameGroup::TextInformationFrames,
Self::Tipl => FrameGroup::TextInformationFrames,
Self::Tit1 => FrameGroup::TextInformationFrames,
Self::Tit2 => FrameGroup::TextInformationFrames,
Self::Tit3 => FrameGroup::TextInformationFrames,
Self::Tkey => FrameGroup::TextInformationFrames,
Self::Tlan => FrameGroup::TextInformationFrames,
Self::Tlen => FrameGroup::TextInformationFrames,
Self::Tmcl => FrameGroup::TextInformationFrames,
Self::Tmed => FrameGroup::TextInformationFrames,
Self::Tmoo => FrameGroup::TextInformationFrames,
Self::Toal => FrameGroup::TextInformationFrames,
Self::Tofn => FrameGroup::TextInformationFrames,
Self::Toly => FrameGroup::TextInformationFrames,
Self::Tope => FrameGroup::TextInformationFrames,
Self::Town => FrameGroup::TextInformationFrames,
Self::Tpe1 => FrameGroup::TextInformationFrames,
Self::Tpe2 => FrameGroup::TextInformationFrames,
Self::Tpe3 => FrameGroup::TextInformationFrames,
Self::Tpe4 => FrameGroup::TextInformationFrames,
Self::Tpos => FrameGroup::TextInformationFrames,
Self::Tpro => FrameGroup::TextInformationFrames,
Self::Tpub => FrameGroup::TextInformationFrames,
Self::Trck => FrameGroup::TextInformationFrames,
Self::Trsn => FrameGroup::TextInformationFrames,
Self::Trso => FrameGroup::TextInformationFrames,
Self::Tsoa => FrameGroup::TextInformationFrames,
Self::Tsop => FrameGroup::TextInformationFrames,
Self::Tsot => FrameGroup::TextInformationFrames,
Self::Tsrc => FrameGroup::TextInformationFrames,
Self::Tsse => FrameGroup::TextInformationFrames,
Self::Tsst => FrameGroup::TextInformationFrames,
Self::Txxx => FrameGroup::TextInformationFrames,
Self::Ufid => FrameGroup::UniqueFileIdentifier,
Self::User => FrameGroup::TermsOfUseFrame,
Self::Uslt => FrameGroup::UnsynchronisedLyricsTextTranscription,
Self::Wcom => FrameGroup::UrlLinkFrames,
Self::Wcop => FrameGroup::UrlLinkFrames,
Self::Woaf => FrameGroup::UrlLinkFrames,
Self::Woar => FrameGroup::UrlLinkFrames,
Self::Woas => FrameGroup::UrlLinkFrames,
Self::Wors => FrameGroup::UrlLinkFrames,
Self::Wpay => FrameGroup::UrlLinkFrames,
Self::Wpub => FrameGroup::UrlLinkFrames,
Self::Wxxx => FrameGroup::UrlLinkFrames,
}
}
pub fn as_str(&self) -> &str {
match self {
Self::Aenc => "AENC",
Self::Apic => "APIC",
Self::Aspi => "ASPI",
Self::Comm => "COMM",
Self::Comr => "COMR",
Self::Encr => "ENCR",
Self::Equ2 => "EQU2",
Self::Etco => "ETCO",
Self::Geob => "GEOB",
Self::Grid => "GRID",
Self::Link => "LINK",
Self::Mcdi => "MCDI",
Self::Mllt => "MLLT",
Self::Owne => "OWNE",
Self::Priv => "PRIV",
Self::Pcnt => "PCNT",
Self::Popm => "POPM",
Self::Poss => "POSS",
Self::Rbuf => "RBUF",
Self::Rva2 => "RVA2",
Self::Rvrb => "RVRB",
Self::Seek => "SEEK",
Self::Sign => "SIGN",
Self::Sylt => "SYLT",
Self::Sytc => "SYTC",
Self::Talb => "TALB",
Self::Tbpm => "TBPB",
Self::Tcom => "TCOM",
Self::Tcon => "TCON",
Self::Tcop => "TCOP",
Self::Tden => "TDEN",
Self::Tdly => "TDLY",
Self::Tdor => "TDOR",
Self::Tdrc => "TDRC",
Self::Tdrl => "TDRL",
Self::Tdtg => "TDTG",
Self::Tenc => "TENC",
Self::Text => "TEXT",
Self::Tflt => "TFLT",
Self::Tipl => "TIPL",
Self::Tit1 => "TIT1",
Self::Tit2 => "TIT2",
Self::Tit3 => "TIT3",
Self::Tkey => "TKEY",
Self::Tlan => "TLAN",
Self::Tlen => "TLEN",
Self::Tmcl => "TMCL",
Self::Tmed => "TMED",
Self::Tmoo => "TMOO",
Self::Toal => "TOAL",
Self::Tofn => "TOFN",
Self::Toly => "TOLY",
Self::Tope => "TOPE",
Self::Town => "TOWN",
Self::Tpe1 => "TPE1",
Self::Tpe2 => "TPE2",
Self::Tpe3 => "TPE3",
Self::Tpe4 => "TPE4",
Self::Tpos => "TPOS",
Self::Tpro => "TPRO",
Self::Tpub => "TPUB",
Self::Trck => "TRCK",
Self::Trsn => "TRSN",
Self::Trso => "TRSO",
Self::Tsoa => "TSOA",
Self::Tsop => "TSOP",
Self::Tsot => "TSOT",
Self::Tsrc => "TSRC",
Self::Tsse => "TSSE",
Self::Tsst => "TSST",
Self::Txxx => "TXXX",
Self::Ufid => "UFID",
Self::User => "USER",
Self::Uslt => "USLT",
Self::Wcom => "WCOM",
Self::Wcop => "WCOP",
Self::Woaf => "WOAF",
Self::Woar => "WOAR",
Self::Woas => "WOAS",
Self::Wors => "WORS",
Self::Wpay => "WPAY",
Self::Wpub => "WPUB",
Self::Wxxx => "WXXX",
}
}
}