public class ID3v23Tag extends AbstractID3v2Tag
Modifier and Type | Field and Description |
---|---|
protected boolean |
compression
The tag is compressed
|
protected boolean |
crcDataFlag
CRC Checksum calculated
|
protected boolean |
experimental
Experiemntal tag
|
protected boolean |
extended
Contains extended header
|
protected static int |
FIELD_TAG_EXT_SIZE_LENGTH |
static byte |
MAJOR_VERSION |
static int |
MASK_V23_CRC_DATA_PRESENT
ID3v2.3 Extended Header bit mask
|
static int |
MASK_V23_EMBEDDED_INFO_FLAG
ID3v2.3 RBUF frame bit mask
|
static int |
MASK_V23_EXPERIMENTAL
ID3v2.3 Header bit mask
|
static int |
MASK_V23_EXTENDED_HEADER
ID3v2.3 Header bit mask
|
static int |
MASK_V23_UNSYNCHRONIZATION
ID3v2.3 Header bit mask
|
static byte |
RELEASE |
static byte |
REVISION |
protected static int |
TAG_EXT_HEADER_CRC_LENGTH |
protected static int |
TAG_EXT_HEADER_DATA_LENGTH |
protected static int |
TAG_EXT_HEADER_LENGTH |
protected static String |
TYPE_CRCDATA |
protected static String |
TYPE_EXPERIMENTAL |
protected static String |
TYPE_EXTENDED |
protected static String |
TYPE_PADDINGSIZE |
protected static String |
TYPE_UNSYNCHRONISATION |
protected boolean |
unsynchronization
All frames in the tag uses unsynchronisation
|
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 |
---|
ID3v23Tag()
Creates a new empty ID3v2_3 datatype.
|
ID3v23Tag(AbstractTag mp3tag)
Constructs a new tag based upon another tag of different version/type
|
ID3v23Tag(ByteBuffer buffer)
Deprecated.
use
ID3v23Tag(ByteBuffer,String) instead |
ID3v23Tag(ByteBuffer buffer,
String loggingFilename)
Creates a new ID3v2_3 datatype.
|
ID3v23Tag(ID3v23Tag copyObject)
Copy Constructor, creates a new ID3v2_3 Tag based on another ID3v2_3 Tag
|
Modifier and Type | Method and Description |
---|---|
void |
addFrame(AbstractID3v2Frame frame)
Add the frame converted to the correct version
|
protected List<AbstractID3v2Frame> |
convertFrame(AbstractID3v2Frame frame)
Convert the frame to the correct frame(s)
|
protected void |
copyPrimitives(AbstractID3v2Tag copyObj)
Copy primitives applicable to v2.3
|
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 to allow special handling for mapping YEAR to TYER and TDAT Frames
|
TagField |
createField(ID3v23FieldKey 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.
|
ID3v23Frame |
createFrame(String id)
Create Frame of correct ID3 version with the specified id
|
void |
createStructure()
For representing the MP3File in an XML Format
|
void |
deleteField(ID3v23FieldKey id3v23FieldKey)
Delete fields with this id3v23FieldKey
|
void |
deleteField(String id)
Delete fields with this (frame) id
|
boolean |
equals(Object obj)
Is Tag Equivalent to another tag
|
List<String> |
getAll(FieldKey genericKey)
Overridden because GENRE can need converting of data to ID3v23 format and
YEAR key is specially processed by getFields() for ID3
|
List<Artwork> |
getArtworkList() |
int |
getCrc32() |
List<TagField> |
getFields(FieldKey genericKey)
Overridden because YEAR key can be served by TDAT, TYER or special aggreagted frame
|
String |
getFirst(ID3v23FieldKey id3v23FieldKey)
Retrieve the first value that exists for this id3v23key
|
protected org.jaudiotagger.tag.id3.AbstractID3v2Tag.FrameAndSubId |
getFrameAndSubIdFromGenericKey(FieldKey genericKey) |
protected ID3Frames |
getID3Frames() |
String |
getIdentifier()
Get full version
|
byte |
getMajorVersion()
Retrieve the Major Version
|
int |
getPaddingSize() |
Comparator |
getPreferredFrameOrderComparator() |
byte |
getRelease()
Retrieve the Release
|
byte |
getRevision()
Retrieve the Revision
|
int |
getSize()
Return frame size based upon the sizes of the tags 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() |
protected void |
loadFrameIntoMap(String frameId,
AbstractID3v2Frame next)
Add frame to the frame map
|
protected void |
loadFrameIntoSpecifiedMap(HashMap map,
String frameId,
AbstractID3v2Frame frame)
Decides what to with the frame that has just been read from file.
|
protected void |
processDuplicateFrame(AbstractID3v2Frame newFrame,
AbstractID3v2Frame existingFrame)
Override to merge TIPL/TMCL into single IPLS frame
|
void |
read(ByteBuffer buffer) |
protected void |
readFrames(ByteBuffer byteBuffer,
int size)
Read the frames
Read from byteBuffer upto size
|
void |
removeFrame(String identifier)
Remove frame(s) with this identifier from tag
|
long |
write(File file,
long audioStartLocation)
Write tag to file
TODO:we currently never write the Extended header , but if we did the size calculation in this
method would be slightly incorrect
|
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, getFileLockForWriting, getFileReadBytes, getFirst, getFirst, getFirstArtwork, getFirstField, getFirstField, getFrame, getFrameOfType, getInvalidFrames, getStartLocationInFile, getV2TagSizeIfExists, hasCommonFields, hasField, hasField, hasFrame, hasFrameAndBody, hasFrameOfType, isEmpty, isId3Tag, isId3Tag, iterator, mergeDuplicateFrames, mergeNumberTotalFrames, 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_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_CRC_LENGTH
protected static int FIELD_TAG_EXT_SIZE_LENGTH
protected static int TAG_EXT_HEADER_DATA_LENGTH
public static final int MASK_V23_UNSYNCHRONIZATION
public static final int MASK_V23_EXTENDED_HEADER
public static final int MASK_V23_EXPERIMENTAL
public static final int MASK_V23_CRC_DATA_PRESENT
public static final int MASK_V23_EMBEDDED_INFO_FLAG
protected boolean crcDataFlag
protected boolean experimental
protected boolean extended
protected boolean unsynchronization
protected boolean compression
public static final byte RELEASE
public static final byte MAJOR_VERSION
public static final byte REVISION
public ID3v23Tag()
public ID3v23Tag(ID3v23Tag copyObject)
copyObject
- public ID3v23Tag(AbstractTag mp3tag)
mp3tag
- public ID3v23Tag(ByteBuffer buffer, String loggingFilename) throws TagException
buffer
- loggingFilename
- TagException
public ID3v23Tag(ByteBuffer buffer) throws TagException
ID3v23Tag(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
public int getCrc32()
protected void copyPrimitives(AbstractID3v2Tag copyObj)
copyPrimitives
in class AbstractID3v2Tag
protected void processDuplicateFrame(AbstractID3v2Frame newFrame, AbstractID3v2Frame existingFrame)
processDuplicateFrame
in class AbstractID3v2Tag
newFrame
- existingFrame
- public void addFrame(AbstractID3v2Frame frame)
AbstractID3v2Tag
addFrame
in class AbstractID3v2Tag
protected List<AbstractID3v2Frame> convertFrame(AbstractID3v2Frame frame) throws InvalidFrameException
AbstractID3v2Tag
convertFrame
in class AbstractID3v2Tag
InvalidFrameException
public String getIdentifier()
AbstractID3Tag
getIdentifier
in class AbstractID3Tag
public int getSize()
getSize
in class AbstractID3v2Tag
public boolean equals(Object obj)
equals
in class AbstractID3v2Tag
obj
- public void read(ByteBuffer buffer) throws TagException
read
in class AbstractTagItem
buffer
- 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
file
- The file to write toIOException
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()
public ID3v23Frame createFrame(String id)
AbstractID3v2Tag
createFrame
in class AbstractID3v2Tag
public TagField createField(ID3v23FieldKey id3Key, String value) throws KeyNotFoundException, FieldDataInvalidException
id3Key
- value
- KeyNotFoundException
FieldDataInvalidException
public String getFirst(ID3v23FieldKey id3v23FieldKey) throws KeyNotFoundException
id3v23FieldKey
- KeyNotFoundException
public void deleteField(ID3v23FieldKey id3v23FieldKey) throws KeyNotFoundException
id3v23FieldKey
- 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
FieldDataInvalidException
public TagField createArtworkField(byte[] data, String mimeType)
data
- mimeType
- of the imagePictureTypes
public int getPaddingSize()
public TagField createField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
createField
in interface Tag
createField
in class AbstractID3v2Tag
genericKey
- is the generic keyvalues
- to storeKeyNotFoundException
FieldDataInvalidException
public String getValue(FieldKey genericKey, int index) throws KeyNotFoundException
AbstractID3v2Tag
getValue
in interface Tag
getValue
in class AbstractID3v2Tag
genericKey
- index
- KeyNotFoundException
protected void loadFrameIntoMap(String frameId, AbstractID3v2Frame next)
AbstractID3v2Tag
loadFrameIntoMap
in class AbstractID3v2Tag
protected void loadFrameIntoSpecifiedMap(HashMap map, String frameId, AbstractID3v2Frame frame)
AbstractID3v2Tag
loadFrameIntoSpecifiedMap
in class AbstractID3v2Tag
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
getAll
in interface Tag
getAll
in class AbstractID3v2Tag
genericKey
- KeyNotFoundException
public List<TagField> getFields(FieldKey genericKey) throws KeyNotFoundException
getFields
in interface Tag
getFields
in class AbstractID3v2Tag
genericKey
- KeyNotFoundException
public void removeFrame(String identifier)
removeFrame
in class AbstractID3v2Tag
identifier
- frameId to look forCopyright © 2005–2020 jthink.net. All rights reserved.