pub struct FrameFlags {
pub tag_alter_preservation: bool,
pub file_alter_preservation: bool,
pub read_only: bool,
pub grouping_identity: Option<u8>,
pub compression: bool,
pub encryption: Option<u8>,
pub unsynchronisation: bool,
pub data_length_indicator: Option<u32>,
}Expand description
Various flags to describe the content of an item
Fields§
§tag_alter_preservation: boolPreserve frame on tag edit
file_alter_preservation: boolPreserve frame on file edit
read_only: boolItem cannot be written to
grouping_identity: Option<u8>The group identifier the frame belongs to
All frames with the same group identifier byte belong to the same group.
compression: boolFrame is zlib compressed
It is required data_length_indicator be set if this is set.
encryption: Option<u8>Frame encryption method symbol
NOTE: Since the encryption method is unknown, lofty cannot do anything with these frames
The encryption method symbol must be > 0x80.
unsynchronisation: boolFrame is unsynchronised
In short, this makes all “0xFF X (X >= 0xE0)” combinations into “0xFF 0x00 X” to avoid confusion with the MPEG frame header, which is often identified by its “frame sync” (11 set bits). It is preferred an ID3v2 tag is either completely unsynchronised or not unsynchronised at all.
NOTE: While unsynchronized data is read, for the sake of simplicity, this flag has no effect when writing. There isn’t much reason to write unsynchronized data.
data_length_indicator: Option<u32>Frame has a data length indicator
The data length indicator is the size of the frame if the flags were all zeroed out.
This is usually used in combination with compression and encryption (depending on encryption method).
If using encryption, the final size must be added.
Implementations§
Source§impl FrameFlags
impl FrameFlags
Sourcepub fn parse_id3v24(flags: u16) -> Self
pub fn parse_id3v24(flags: u16) -> Self
Parse the flags from an ID3v2.4 frame
NOTE: If any of the following flags are set, they will be set to Some(0):
grouping_identityencryptiondata_length_indicator
Sourcepub fn parse_id3v23(flags: u16) -> Self
pub fn parse_id3v23(flags: u16) -> Self
Parse the flags from an ID3v2.3 frame
NOTE: If any of the following flags are set, they will be set to Some(0):
grouping_identityencryption
Sourcepub fn as_id3v24_bytes(&self) -> u16
pub fn as_id3v24_bytes(&self) -> u16
Get the ID3v2.4 byte representation of the flags
Sourcepub fn as_id3v23_bytes(&self) -> u16
pub fn as_id3v23_bytes(&self) -> u16
Get the ID3v2.3 byte representation of the flags
Trait Implementations§
Source§impl Clone for FrameFlags
impl Clone for FrameFlags
Source§fn clone(&self) -> FrameFlags
fn clone(&self) -> FrameFlags
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more