public class ID3v24Tag extends AbstractID3v2Tag
Modifier and Type | Field and Description |
---|---|
protected int |
crcData
CRC Checksum
|
protected boolean |
crcDataFlag
CRC Checksum calculated
|
protected boolean |
experimental
Experiemntal tag
|
protected boolean |
extended
Contains extended header
|
protected boolean |
footer
Contains a footer
|
protected byte |
imageEncodingRestriction
If Set Image encoding restrictions
0 No restrictions
1 Images are encoded only with PNG [PNG] or JPEG [JFIF].
|
protected byte |
imageSizeRestriction
If set Image size restrictions
00 No restrictions
01 All images are 256x256 pixels or smaller.
|
static byte |
MAJOR_VERSION |
static int |
MASK_V24_COMPRESSION
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_CRC_DATA_PRESENT
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_DATA_LENGTH_INDICATOR
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_ENCRYPTION
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_EXPERIMENTAL
ID3v2.4 Header bit mask
|
static int |
MASK_V24_EXTENDED_HEADER
ID3v2.4 Header bit mask
|
static int |
MASK_V24_FILE_ALTER_PRESERVATION
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_FOOTER_PRESENT
ID3v2.4 Header bit mask
|
static int |
MASK_V24_FRAME_UNSYNCHRONIZATION
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_GROUPING_IDENTITY
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_IMAGE_ENCODING
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_IMAGE_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_READ_ONLY
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_TAG_ALTER_PRESERVATION
ID3v2.4 Header Footer bit mask
|
static int |
MASK_V24_TAG_RESTRICTIONS
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_TAG_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_TAG_UPDATE
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_TEXT_ENCODING_RESTRICTIONS
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask
|
static int |
MASK_V24_UNSYNCHRONIZATION
ID3v2.4 Header bit mask
|
protected int |
paddingSize
Tag padding
|
static byte |
RELEASE |
static byte |
REVISION |
protected static int |
TAG_EXT_HEADER_CRC_DATA_LENGTH |
protected static int |
TAG_EXT_HEADER_CRC_LENGTH |
protected static int |
TAG_EXT_HEADER_LENGTH |
protected static int |
TAG_EXT_HEADER_RESTRICTION_DATA_LENGTH |
protected static int |
TAG_EXT_HEADER_RESTRICTION_LENGTH |
protected static int |
TAG_EXT_HEADER_UPDATE_LENGTH |
protected static int |
TAG_EXT_NUMBER_BYTES_DATA_LENGTH |
protected boolean |
tagRestriction
Tag has restrictions
|
protected byte |
tagSizeRestriction
If set then Tag Size Restrictions
00 No more than 128 frames and 1 MB total tag size.
|
protected byte |
textEncodingRestriction
If set Text encoding restrictions
0 No restrictions
1 Strings are only encoded with ISO-8859-1 [ISO-8859-1] or
UTF-8 [UTF-8].
|
protected byte |
textFieldSizeRestriction
If set Text fields size restrictions
00 No restrictions
01 No string is longer than 1024 characters.
|
protected static String |
TYPE_CRCDATA |
protected static String |
TYPE_EXPERIMENTAL |
protected static String |
TYPE_EXTENDED |
protected static String |
TYPE_FOOTER |
protected static String |
TYPE_IMAGEENCODINGRESTRICTION |
protected static String |
TYPE_IMAGESIZERESTRICTION |
protected static String |
TYPE_PADDINGSIZE |
protected static String |
TYPE_TAGRESTRICTION |
protected static String |
TYPE_TAGSIZERESTRICTION |
protected static String |
TYPE_TEXTENCODINGRESTRICTION |
protected static String |
TYPE_TEXTFIELDSIZERESTRICTION |
protected static String |
TYPE_UNSYNCHRONISATION |
protected static String |
TYPE_UPDATETAG |
protected boolean |
unsynchronization
All frames in the tag uses unsynchronisation
|
protected boolean |
updateTag
Tag is an update
|
duplicateBytes, duplicateFrameId, emptyFrameBytes, encryptedFrameMap, FIELD_TAG_FLAG_LENGTH, FIELD_TAG_FLAG_POS, FIELD_TAG_MAJOR_VERSION_LENGTH, FIELD_TAG_MAJOR_VERSION_POS, FIELD_TAG_MINOR_VERSION_LENGTH, FIELD_TAG_MINOR_VERSION_POS, FIELD_TAG_SIZE_LENGTH, FIELD_TAG_SIZE_POS, FIELD_TAGID_LENGTH, FIELD_TAGID_POS, fileReadSize, frameMap, invalidFrames, TAG_HEADER_LENGTH, TAG_ID, TAG_SIZE_INCREMENT, TAGID, TYPE_BODY, TYPE_DUPLICATEBYTES, TYPE_DUPLICATEFRAMEID, TYPE_EMPTYFRAMEBYTES, TYPE_FILEREADSIZE, TYPE_HEADER, TYPE_INVALIDFRAMES
logger, TAG_RELEASE
TYPE_TAG
Constructor and Description |
---|
ID3v24Tag()
Creates a new empty ID3v2_4 datatype.
|
ID3v24Tag(AbstractTag mp3tag)
Creates a new ID3v2_4 datatype based on another (non 2.4) tag
|
ID3v24Tag(ByteBuffer buffer)
Deprecated.
use
ID3v24Tag(ByteBuffer,String) instead |
ID3v24Tag(ByteBuffer buffer,
String loggingFilename)
Creates a new ID3v2_4 datatype.
|
ID3v24Tag(ID3v24Tag copyObject)
Copy Constructor, creates a new ID3v2_4 Tag based on another ID3v2_4 Tag
|
Modifier and Type | Method and Description |
---|---|
void |
addFrame(AbstractID3v2Frame frame)
Copy the frame
If the frame is already an ID3v24 frame we can add as is, if not we need to convert
to id3v24 frame(s)
|
protected List<AbstractID3v2Frame> |
convertFrame(AbstractID3v2Frame frame)
Convert frame into ID3v24 frame(s)
|
protected void |
copyPrimitives(AbstractID3v2Tag copyObj)
Copy primitives applicable to v2.4, this is used when cloning a v2.4 datatype
and other objects such as v2.3 so need to check instanceof
|
TagField |
createArtworkField(byte[] data,
String mimeType)
Create Artwork
|
TagField |
createField(Artwork artwork)
Create artwork field based on the data in artwork
|
TagField |
createField(FieldKey genericKey,
String... values)
Overridden for special Genre support
|
TagField |
createField(ID3v24FieldKey id3Key,
String value)
Create Frame for Id3 Key
Only textual data supported at the moment, should only be used with frames that
support a simple string argument.
|
ID3v24Frame |
createFrame(String id)
Create a new frame with the specified frameid
|
void |
createStructure()
Display the tag in an XMLFormat
|
void |
deleteField(ID3v24FieldKey id3v24FieldKey)
Delete fields with this id3v24FieldKey
|
void |
deleteField(String id)
Delete fields with this (frame) id
|
boolean |
equals(Object obj)
Is this tag equivalent to another
|
List<String> |
getAll(FieldKey genericKey)
Maps the generic key to the id3 key and return the list of values for this field as strings
|
List<Artwork> |
getArtworkList() |
String |
getFirst(ID3v24FieldKey id3v24FieldKey)
Retrieve the first value that exists for this id3v24key
|
protected org.jaudiotagger.tag.id3.AbstractID3v2Tag.FrameAndSubId |
getFrameAndSubIdFromGenericKey(FieldKey genericKey) |
protected ID3Frames |
getID3Frames() |
String |
getIdentifier()
Get full version
|
byte |
getMajorVersion()
Retrieve the Major Version
|
Comparator |
getPreferredFrameOrderComparator() |
byte |
getRelease()
Retrieve the Release
|
byte |
getRevision()
Retrieve the Revision
|
int |
getSize()
Return tag size based upon the sizes of the frames rather than the physical
no of bytes between start of ID3Tag and start of Audio Data.
|
String |
getValue(FieldKey genericKey,
int index)
Retrieve the value that exists for this generic key and this index
Have to do some special mapping for certain generic keys because they share frame
with another generic key.
|
boolean |
isUnsynchronization()
Are all frames within this tag unsynchronized
|
protected void |
processDuplicateFrame(AbstractID3v2Frame newFrame,
AbstractID3v2Frame existingFrame)
Two different frames both converted to TDRCFrames, now if this is the case one of them
may have actually have been created as a FrameUnsupportedBody because TDRC is only
supported in ID3v24, but is often created in v23 tags as well together with the valid TYER
frame OR it might be that we have two v23 frames that map to TDRC such as TYER,TIME or TDAT
|
void |
read(ByteBuffer byteBuffer) |
protected void |
readFrames(ByteBuffer byteBuffer,
int size)
Read frames from tag
|
long |
write(File file,
long audioStartLocation)
Write tag to file.
|
void |
write(WritableByteChannel channel,
int currentTagSize)
Write tag to channel.
|
addField, addField, addField, calculateTagSize, copyFrameIntoMap, copyFrames, createCompilationField, createLinkedArtworkField, createStructureBody, createStructureHeader, delete, deleteArtworkField, deleteField, doCreateTagField, doDeleteTagField, doGetValueAtIndex, doGetValues, getDuplicateBytes, getDuplicateFrameId, getEmptyFrameBytes, getEncryptedFrame, getEndLocationInFile, getFieldCount, getFieldCountIncludingSubValues, getFields, getFields, getFields, getFileLockForWriting, getFileReadBytes, getFirst, getFirst, getFirstArtwork, getFirstField, getFirstField, getFrame, getFrameOfType, getInvalidFrames, getStartLocationInFile, getV2TagSizeIfExists, hasCommonFields, hasField, hasField, hasFrame, hasFrameAndBody, hasFrameOfType, isEmpty, isId3Tag, isId3Tag, iterator, loadFrameIntoMap, loadFrameIntoSpecifiedMap, mergeDuplicateFrames, mergeNumberTotalFrames, removeFrame, removeFrameOfType, removeUnsupportedFrames, seek, setEncoding, setEndLocationInFile, setField, setField, setField, setFrame, setFrame, setStartLocationInFile, toString, write, write, write, writeBufferToFile, writeFramesToBuffer, writePadding
getLoggingFilename, setLoggingFilename
isSubsetOf
protected static final String TYPE_FOOTER
protected static final String TYPE_IMAGEENCODINGRESTRICTION
protected static final String TYPE_IMAGESIZERESTRICTION
protected static final String TYPE_TAGRESTRICTION
protected static final String TYPE_TAGSIZERESTRICTION
protected static final String TYPE_TEXTENCODINGRESTRICTION
protected static final String TYPE_TEXTFIELDSIZERESTRICTION
protected static final String TYPE_UPDATETAG
protected static final String TYPE_CRCDATA
protected static final String TYPE_EXPERIMENTAL
protected static final String TYPE_EXTENDED
protected static final String TYPE_PADDINGSIZE
protected static final String TYPE_UNSYNCHRONISATION
protected static int TAG_EXT_HEADER_LENGTH
protected static int TAG_EXT_HEADER_UPDATE_LENGTH
protected static int TAG_EXT_HEADER_CRC_LENGTH
protected static int TAG_EXT_HEADER_RESTRICTION_LENGTH
protected static int TAG_EXT_HEADER_CRC_DATA_LENGTH
protected static int TAG_EXT_HEADER_RESTRICTION_DATA_LENGTH
protected static int TAG_EXT_NUMBER_BYTES_DATA_LENGTH
public static final int MASK_V24_UNSYNCHRONIZATION
public static final int MASK_V24_EXTENDED_HEADER
public static final int MASK_V24_EXPERIMENTAL
public static final int MASK_V24_FOOTER_PRESENT
public static final int MASK_V24_TAG_UPDATE
public static final int MASK_V24_CRC_DATA_PRESENT
public static final int MASK_V24_TAG_RESTRICTIONS
public static final int MASK_V24_TAG_SIZE_RESTRICTIONS
public static final int MASK_V24_TEXT_ENCODING_RESTRICTIONS
public static final int MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS
public static final int MASK_V24_IMAGE_ENCODING
public static final int MASK_V24_IMAGE_SIZE_RESTRICTIONS
public static final int MASK_V24_TAG_ALTER_PRESERVATION
public static final int MASK_V24_FILE_ALTER_PRESERVATION
public static final int MASK_V24_READ_ONLY
public static final int MASK_V24_GROUPING_IDENTITY
public static final int MASK_V24_COMPRESSION
public static final int MASK_V24_ENCRYPTION
public static final int MASK_V24_FRAME_UNSYNCHRONIZATION
public static final int MASK_V24_DATA_LENGTH_INDICATOR
protected boolean crcDataFlag
protected boolean experimental
protected boolean extended
protected boolean unsynchronization
protected int crcData
protected boolean footer
protected boolean updateTag
protected boolean tagRestriction
protected byte imageEncodingRestriction
protected byte imageSizeRestriction
protected byte tagSizeRestriction
protected byte textEncodingRestriction
protected int paddingSize
protected byte textFieldSizeRestriction
public static final byte RELEASE
public static final byte MAJOR_VERSION
public static final byte REVISION
public ID3v24Tag()
public ID3v24Tag(ID3v24Tag copyObject)
copyObject
- public ID3v24Tag(AbstractTag mp3tag)
mp3tag
- public ID3v24Tag(ByteBuffer buffer, String loggingFilename) throws TagException
buffer
- loggingFilename
- TagException
public ID3v24Tag(ByteBuffer buffer) throws TagException
ID3v24Tag(ByteBuffer,String)
insteadbuffer
- TagException
public byte getRelease()
getRelease
in class AbstractID3Tag
public byte getMajorVersion()
getMajorVersion
in class AbstractID3Tag
public byte getRevision()
getRevision
in class AbstractID3Tag
protected void copyPrimitives(AbstractID3v2Tag copyObj)
copyPrimitives
in class AbstractID3v2Tag
public void addFrame(AbstractID3v2Frame frame)
addFrame
in class AbstractID3v2Tag
frame
- protected List<AbstractID3v2Frame> convertFrame(AbstractID3v2Frame frame) throws InvalidFrameException
convertFrame
in class AbstractID3v2Tag
frame
- InvalidFrameException
protected void processDuplicateFrame(AbstractID3v2Frame newFrame, AbstractID3v2Frame existingFrame)
processDuplicateFrame
in class AbstractID3v2Tag
newFrame
- existingFrame
- public String getIdentifier()
AbstractID3Tag
getIdentifier
in class AbstractID3Tag
public int getSize()
getSize
in class AbstractID3v2Tag
public boolean equals(Object obj)
AbstractID3v2Tag
equals
in class AbstractID3v2Tag
obj
- public void read(ByteBuffer byteBuffer) throws TagException
read
in class AbstractTagItem
byteBuffer
- file to read fromTagException
- on any exception generated by this library.protected void readFrames(ByteBuffer byteBuffer, int size)
byteBuffer
- size
- public long write(File file, long audioStartLocation) throws IOException
write
in class AbstractID3v2Tag
IOException
public void write(WritableByteChannel channel, int currentTagSize) throws IOException
write
in class AbstractID3v2Tag
IOException
- TODO should be abstractpublic void createStructure()
createStructure
in class AbstractID3v2Tag
public boolean isUnsynchronization()
Because synchronization occurs at the frame level it is not normally desirable to unsynchronize all frames and hence this flag is not normally set.
public ID3v24Frame createFrame(String id)
createFrame
in class AbstractID3v2Tag
id
- public TagField createField(ID3v24FieldKey id3Key, String value) throws KeyNotFoundException, FieldDataInvalidException
id3Key
- value
- KeyNotFoundException
FieldDataInvalidException
public String getFirst(ID3v24FieldKey id3v24FieldKey) throws KeyNotFoundException
id3v24FieldKey
- KeyNotFoundException
public void deleteField(ID3v24FieldKey id3v24FieldKey) throws KeyNotFoundException
id3v24FieldKey
- KeyNotFoundException
public void deleteField(String id)
id
- protected org.jaudiotagger.tag.id3.AbstractID3v2Tag.FrameAndSubId getFrameAndSubIdFromGenericKey(FieldKey genericKey)
getFrameAndSubIdFromGenericKey
in class AbstractID3v2Tag
protected ID3Frames getID3Frames()
getID3Frames
in class AbstractID3v2Tag
public Comparator getPreferredFrameOrderComparator()
getPreferredFrameOrderComparator
in class AbstractID3v2Tag
public List<Artwork> getArtworkList()
public TagField createField(Artwork artwork) throws FieldDataInvalidException
Tag
FieldDataInvalidException
public TagField createArtworkField(byte[] data, String mimeType)
data
- mimeType
- of the imagePictureTypes
public TagField createField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
createField
in interface Tag
createField
in class AbstractID3v2Tag
genericKey
- is the generic keyvalues
- KeyNotFoundException
FieldDataInvalidException
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
getAll
in interface Tag
getAll
in class AbstractID3v2Tag
genericKey
- KeyNotFoundException
public String getValue(FieldKey genericKey, int index) throws KeyNotFoundException
getValue
in interface Tag
getValue
in class AbstractID3v2Tag
genericKey
- KeyNotFoundException
Copyright © 2005–2020 jthink.net. All rights reserved.