public class ID3v22Tag extends AbstractID3v2Tag
Modifier and Type | Field and Description |
---|---|
protected boolean |
compression
The tag is compressed, although no compression scheme is defined in ID3v22
|
static byte |
MAJOR_VERSION |
static int |
MASK_V22_COMPRESSION
Bit mask to indicate tag is compressed, although compression is not
actually defined in v22 so just ignored
|
static int |
MASK_V22_UNSYNCHRONIZATION
Bit mask to indicate tag is Unsychronization
|
static byte |
RELEASE |
static byte |
REVISION |
protected static String |
TYPE_COMPRESSION |
protected static String |
TYPE_UNSYNCHRONISATION |
protected boolean |
unsynchronization
If set 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 |
---|
ID3v22Tag()
Creates a new empty ID3v2_2 tag.
|
ID3v22Tag(AbstractTag mp3tag)
Constructs a new tag based upon another tag of different version/type
|
ID3v22Tag(ByteBuffer buffer)
Deprecated.
use
ID3v22Tag(ByteBuffer,String) instead |
ID3v22Tag(ByteBuffer buffer,
String loggingFilename)
Creates a new ID3v2_2 datatype.
|
ID3v22Tag(ID3v22Tag copyObject)
Copy Constructor, creates a new ID3v2_2 Tag based on another ID3v2_2 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.2
|
TagField |
createArtworkField(byte[] data,
String mimeType) |
TagField |
createField(Artwork artwork)
Create artwork field based on the data in artwork
|
TagField |
createField(FieldKey genericKey,
String... values)
Create a new field
Only MUSICIAN field make use of Varargs values field
|
TagField |
createField(ID3v22FieldKey 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.
|
ID3v22Frame |
createFrame(String id)
Create Frame
|
void |
createStructure() |
void |
deleteField(ID3v22FieldKey id3v22FieldKey)
Delete fields with this id3v22FieldKey
|
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(ID3v22FieldKey id3v22FieldKey)
Retrieve the first value that exists for this id3v22key
|
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 frame size based upon the sizes of the frames rather than the size
including padding recorded in the tag header
|
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 |
isCompression() |
boolean |
isUnsynchronization() |
protected void |
loadFrameIntoMap(String frameId,
AbstractID3v2Frame next)
Add frame to the frame map
|
void |
read(ByteBuffer byteBuffer) |
protected void |
readFrames(ByteBuffer byteBuffer,
int size)
Read frames from tag
|
protected void |
translateFrame(AbstractID3v2Frame frame)
This is used when we need to translate a single frame into multiple frames,
currently required for TDRC frames.
|
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, loadFrameIntoSpecifiedMap, mergeDuplicateFrames, mergeNumberTotalFrames, processDuplicateFrame, 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_COMPRESSION
protected static final String TYPE_UNSYNCHRONISATION
public static final int MASK_V22_UNSYNCHRONIZATION
public static final int MASK_V22_COMPRESSION
protected boolean compression
protected boolean unsynchronization
public static final byte RELEASE
public static final byte MAJOR_VERSION
public static final byte REVISION
public ID3v22Tag()
public ID3v22Tag(ID3v22Tag copyObject)
copyObject
- public ID3v22Tag(AbstractTag mp3tag)
mp3tag
- public ID3v22Tag(ByteBuffer buffer, String loggingFilename) throws TagException
buffer
- loggingFilename
- TagException
public ID3v22Tag(ByteBuffer buffer) throws TagException
ID3v22Tag(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 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
- protected List<AbstractID3v2Frame> convertFrame(AbstractID3v2Frame frame) throws InvalidFrameException
AbstractID3v2Tag
convertFrame
in class AbstractID3v2Tag
InvalidFrameException
public void addFrame(AbstractID3v2Frame frame)
AbstractID3v2Tag
addFrame
in class AbstractID3v2Tag
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
- protected void translateFrame(AbstractID3v2Frame frame)
frame
- 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()
public boolean isCompression()
public ID3v22Frame createFrame(String id)
createFrame
in class AbstractID3v2Tag
id
- frameidpublic TagField createField(ID3v22FieldKey id3Key, String value) throws KeyNotFoundException, FieldDataInvalidException
id3Key
- value
- KeyNotFoundException
FieldDataInvalidException
public TagField createField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
AbstractID3v2Tag
createField
in interface Tag
createField
in class AbstractID3v2Tag
genericKey
- is the generic keyvalues
- to storeKeyNotFoundException
FieldDataInvalidException
public String getFirst(ID3v22FieldKey id3v22FieldKey) throws KeyNotFoundException
id3v22FieldKey
- KeyNotFoundException
public void deleteField(ID3v22FieldKey id3v22FieldKey) throws KeyNotFoundException
id3v22FieldKey
- 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 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
AbstractID3v2Tag
getValue
in interface Tag
getValue
in class AbstractID3v2Tag
KeyNotFoundException
protected void loadFrameIntoMap(String frameId, AbstractID3v2Frame next)
AbstractID3v2Tag
loadFrameIntoMap
in class AbstractID3v2Tag
Copyright © 2005–2020 jthink.net. All rights reserved.