|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.tag.id3.AbstractTagItem org.jaudiotagger.tag.id3.AbstractTag org.jaudiotagger.tag.id3.AbstractID3Tag org.jaudiotagger.tag.id3.AbstractID3v2Tag org.jaudiotagger.tag.id3.ID3v24Tag
public class ID3v24Tag
Represents an ID3v2.4 tag.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jaudiotagger.tag.id3.AbstractID3v2Tag |
---|
AbstractID3v2Tag.FrameAndSubId |
Field Summary | |
---|---|
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 java.lang.String |
TYPE_CRCDATA
|
protected static java.lang.String |
TYPE_EXPERIMENTAL
|
protected static java.lang.String |
TYPE_EXTENDED
|
protected static java.lang.String |
TYPE_FOOTER
|
protected static java.lang.String |
TYPE_IMAGEENCODINGRESTRICTION
|
protected static java.lang.String |
TYPE_IMAGESIZERESTRICTION
|
protected static java.lang.String |
TYPE_PADDINGSIZE
|
protected static java.lang.String |
TYPE_TAGRESTRICTION
|
protected static java.lang.String |
TYPE_TAGSIZERESTRICTION
|
protected static java.lang.String |
TYPE_TEXTENCODINGRESTRICTION
|
protected static java.lang.String |
TYPE_TEXTFIELDSIZERESTRICTION
|
protected static java.lang.String |
TYPE_UNSYNCHRONISATION
|
protected static java.lang.String |
TYPE_UPDATETAG
|
protected boolean |
unsynchronization
All frames in the tag uses unsynchronisation |
protected boolean |
updateTag
Tag is an update |
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag |
---|
logger, TAG_RELEASE |
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTag |
---|
TYPE_TAG |
Constructor Summary | |
---|---|
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(java.nio.ByteBuffer buffer)
Deprecated. use ID3v24Tag(ByteBuffer,String) instead |
|
ID3v24Tag(java.nio.ByteBuffer buffer,
java.lang.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 |
Method Summary | |
---|---|
protected void |
addFrame(AbstractID3v2Frame frame)
|
protected void |
copyFrameIntoMap(java.lang.String id,
AbstractID3v2Frame newFrame)
|
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,
java.lang.String mimeType)
Create Artwork |
TagField |
createField(Artwork artwork)
Create artwork field based on the data in artwork |
ID3v24Frame |
createFrame(java.lang.String id)
Create a new frame with the specified frameid |
void |
createStructure()
Display the tag in an XMLFormat |
TagField |
createTagField(ID3v24FieldKey id3Key,
java.lang.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. |
void |
deleteTagField(ID3v24FieldKey id3v24FieldKey)
Delete fields with this id3v24FieldKey |
boolean |
equals(java.lang.Object obj)
Is this tag equivalent to another |
protected java.lang.String |
getAlbumId()
|
protected java.lang.String |
getArtistId()
|
java.util.List<Artwork> |
getArtworkList()
|
protected java.lang.String |
getCommentId()
|
java.lang.String |
getFirst(ID3v24FieldKey id3v24FieldKey)
Retrieve the first value that exists for this id3v24key |
protected AbstractID3v2Tag.FrameAndSubId |
getFrameAndSubIdFromGenericKey(FieldKey genericKey)
|
protected java.lang.String |
getGenreId()
|
protected ID3Frames |
getID3Frames()
|
java.lang.String |
getIdentifier()
Get full version |
byte |
getMajorVersion()
Retrieve the Major Version |
java.util.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. |
protected java.lang.String |
getTitleId()
|
protected java.lang.String |
getTrackId()
|
protected java.lang.String |
getYearId()
|
boolean |
isUnsynchronization()
Are all frame swithin this tag unsynchronized |
void |
read(java.nio.ByteBuffer byteBuffer)
|
private void |
readExtendedHeader(java.nio.ByteBuffer byteBuffer,
int size)
Read the optional extended header |
protected void |
readFrames(java.nio.ByteBuffer byteBuffer,
int size)
Read frames from tag |
private void |
readHeaderFlags(java.nio.ByteBuffer byteBuffer)
Read header flags |
int |
readSize(java.nio.ByteBuffer buffer)
Read the size of a tag, based on the value written in the tag header |
void |
write(java.io.File file,
long audioStartLocation)
Write tag to file. |
void |
write(java.nio.channels.WritableByteChannel channel)
Write tag to channel. |
private java.nio.ByteBuffer |
writeHeaderToBuffer(int padding,
int size)
Write the ID3 header to the ByteBuffer. |
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag |
---|
getLoggingFilename, setLoggingFilename, toString |
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem |
---|
isSubsetOf |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jaudiotagger.tag.Tag |
---|
toString |
Field Detail |
---|
protected static final java.lang.String TYPE_FOOTER
protected static final java.lang.String TYPE_IMAGEENCODINGRESTRICTION
protected static final java.lang.String TYPE_IMAGESIZERESTRICTION
protected static final java.lang.String TYPE_TAGRESTRICTION
protected static final java.lang.String TYPE_TAGSIZERESTRICTION
protected static final java.lang.String TYPE_TEXTENCODINGRESTRICTION
protected static final java.lang.String TYPE_TEXTFIELDSIZERESTRICTION
protected static final java.lang.String TYPE_UPDATETAG
protected static final java.lang.String TYPE_CRCDATA
protected static final java.lang.String TYPE_EXPERIMENTAL
protected static final java.lang.String TYPE_EXTENDED
protected static final java.lang.String TYPE_PADDINGSIZE
protected static final java.lang.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
Constructor Detail |
---|
public ID3v24Tag()
public ID3v24Tag(ID3v24Tag copyObject)
copyObject
- public ID3v24Tag(AbstractTag mp3tag)
mp3tag
- public ID3v24Tag(java.nio.ByteBuffer buffer, java.lang.String loggingFilename) throws TagException
buffer
- loggingFilename
-
TagException
public ID3v24Tag(java.nio.ByteBuffer buffer) throws TagException
ID3v24Tag(ByteBuffer,String)
instead
buffer
-
TagException
Method Detail |
---|
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
protected void addFrame(AbstractID3v2Frame frame)
addFrame
in class AbstractID3v2Tag
protected void copyFrameIntoMap(java.lang.String id, AbstractID3v2Frame newFrame)
copyFrameIntoMap
in class AbstractID3v2Tag
public java.lang.String getIdentifier()
AbstractID3Tag
getIdentifier
in class AbstractID3Tag
public int getSize()
getSize
in class AbstractID3v2Tag
public boolean equals(java.lang.Object obj)
AbstractID3v2Tag
equals
in class AbstractID3v2Tag
obj
-
public int readSize(java.nio.ByteBuffer buffer)
buffer
-
TagException
private void readHeaderFlags(java.nio.ByteBuffer byteBuffer) throws TagException
Log info messages for falgs that have been set and log warnings when bits have been set for unknown flags
byteBuffer
-
TagException
private void readExtendedHeader(java.nio.ByteBuffer byteBuffer, int size) throws InvalidTagException
byteBuffer
- size
-
InvalidTagException
public void read(java.nio.ByteBuffer byteBuffer) throws TagException
read
in class AbstractTagItem
byteBuffer
- file to read from
TagException
- on any exception generated by this library.protected void readFrames(java.nio.ByteBuffer byteBuffer, int size)
byteBuffer
- size
- private java.nio.ByteBuffer writeHeaderToBuffer(int padding, int size) throws java.io.IOException
padding
- is the size of the paddingsize
- is the size of the body data
java.io.IOException
public void write(java.io.File file, long audioStartLocation) throws java.io.IOException
write
in class AbstractID3v2Tag
java.io.IOException
- TODO should be abstractpublic void write(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
write
in class AbstractID3v2Tag
java.io.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.
protected java.lang.String getArtistId()
getArtistId
in class AbstractID3v2Tag
protected java.lang.String getAlbumId()
getAlbumId
in class AbstractID3v2Tag
protected java.lang.String getTitleId()
getTitleId
in class AbstractID3v2Tag
protected java.lang.String getTrackId()
getTrackId
in class AbstractID3v2Tag
protected java.lang.String getYearId()
getYearId
in class AbstractID3v2Tag
protected java.lang.String getCommentId()
getCommentId
in class AbstractID3v2Tag
protected java.lang.String getGenreId()
getGenreId
in class AbstractID3v2Tag
public ID3v24Frame createFrame(java.lang.String id)
createFrame
in class AbstractID3v2Tag
id
-
public TagField createTagField(ID3v24FieldKey id3Key, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
id3Key
- value
-
KeyNotFoundException
FieldDataInvalidException
public java.lang.String getFirst(ID3v24FieldKey id3v24FieldKey) throws KeyNotFoundException
id3v24FieldKey
-
KeyNotFoundException
public void deleteTagField(ID3v24FieldKey id3v24FieldKey) throws KeyNotFoundException
id3v24FieldKey
-
KeyNotFoundException
protected AbstractID3v2Tag.FrameAndSubId getFrameAndSubIdFromGenericKey(FieldKey genericKey)
getFrameAndSubIdFromGenericKey
in class AbstractID3v2Tag
protected ID3Frames getID3Frames()
getID3Frames
in class AbstractID3v2Tag
public java.util.Comparator getPreferredFrameOrderComparator()
getPreferredFrameOrderComparator
in class AbstractID3v2Tag
public java.util.List<Artwork> getArtworkList()
public TagField createField(Artwork artwork) throws FieldDataInvalidException
Tag
FieldDataInvalidException
public TagField createArtworkField(byte[] data, java.lang.String mimeType)
data
- mimeType
- of the image
PictureTypes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |