org.jaudiotagger.tag.id3
Class ID3v24Tag

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTag
          extended by org.jaudiotagger.tag.id3.AbstractID3Tag
              extended by org.jaudiotagger.tag.id3.AbstractID3v2Tag
                  extended by org.jaudiotagger.tag.id3.ID3v24Tag
All Implemented Interfaces:
Tag

public class ID3v24Tag
extends AbstractID3v2Tag

Represents an ID3v2.4 tag.

Version:
$Id: ID3v24Tag.java,v 1.39 2007/12/03 13:28:04 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Field Summary
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
static byte RELEASE
           
static byte REVISION
           
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3v2Tag
frameMap, TAG_HEADER_LENGTH
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag
logger
 
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
 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
 java.lang.String getFirst(ID3v24FieldKey id3v24FieldKey)
          Retrieve the first value that exists for this id3v24key
 java.lang.String getIdentifier()
          Get full version
 byte getMajorVersion()
          Retrieve the Major Version
 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.
 boolean isUnsynchronization()
          Are all frame swithin this tag unsynchronized

 void read(java.nio.ByteBuffer byteBuffer)
          Read Tag from Specified file.
 void write(java.io.File file, long audioStartLocation)
          Write this tag to file.
 void write(java.nio.channels.WritableByteChannel channel)
          Write tag to channel
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3v2Tag
add, addAlbum, addArtist, addComment, addGenre, addTitle, addTrack, addYear, adjustPadding, createAlbumField, createArtistField, createArtworkField, createCommentField, createGenreField, createLinkedArtworkField, createStructureBody, createStructureHeader, createTagField, createTitleField, createTrackField, createYearField, delete, deleteTagField, get, get, getAlbum, getArtist, getComment, getDuplicateBytes, getDuplicateFrameId, getEmptyFrameBytes, getFieldCount, getFields, getFileReadBytes, getFirst, getFirst, getFirstAlbum, getFirstArtist, getFirstComment, getFirstField, getFirstGenre, getFirstTitle, getFirstTrack, getFirstYear, getFrame, getFrameCount, getFrameOfType, getGenre, getInvalidFrameBytes, getTitle, getTrack, getV2TagSizeIfExists, getYear, hasCommonFields, hasField, hasFrame, hasFrameAndBody, hasFrameOfType, isEmpty, iterator, removeFrame, removeFrameOfType, removeUnsupportedFrames, seek, set, setAlbum, setArtist, setComment, setEncoding, setFrame, setFrame, setGenre, setTitle, setTrack, setYear, write
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag
toString
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
isSubsetOf
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.Tag
toString
 

Field Detail

MASK_V24_UNSYNCHRONIZATION

public static final int MASK_V24_UNSYNCHRONIZATION
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_EXTENDED_HEADER

public static final int MASK_V24_EXTENDED_HEADER
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_EXPERIMENTAL

public static final int MASK_V24_EXPERIMENTAL
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_FOOTER_PRESENT

public static final int MASK_V24_FOOTER_PRESENT
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_UPDATE

public static final int MASK_V24_TAG_UPDATE
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_CRC_DATA_PRESENT

public static final int MASK_V24_CRC_DATA_PRESENT
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_RESTRICTIONS

public static final int MASK_V24_TAG_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_SIZE_RESTRICTIONS

public static final int MASK_V24_TAG_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TEXT_ENCODING_RESTRICTIONS

public static final int MASK_V24_TEXT_ENCODING_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS

public static final int MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_IMAGE_ENCODING

public static final int MASK_V24_IMAGE_ENCODING
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_IMAGE_SIZE_RESTRICTIONS

public static final int MASK_V24_IMAGE_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_ALTER_PRESERVATION

public static final int MASK_V24_TAG_ALTER_PRESERVATION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_FILE_ALTER_PRESERVATION

public static final int MASK_V24_FILE_ALTER_PRESERVATION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_READ_ONLY

public static final int MASK_V24_READ_ONLY
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_GROUPING_IDENTITY

public static final int MASK_V24_GROUPING_IDENTITY
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_COMPRESSION

public static final int MASK_V24_COMPRESSION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_ENCRYPTION

public static final int MASK_V24_ENCRYPTION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_FRAME_UNSYNCHRONIZATION

public static final int MASK_V24_FRAME_UNSYNCHRONIZATION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_DATA_LENGTH_INDICATOR

public static final int MASK_V24_DATA_LENGTH_INDICATOR
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

RELEASE

public static final byte RELEASE
See Also:
Constant Field Values

MAJOR_VERSION

public static final byte MAJOR_VERSION
See Also:
Constant Field Values

REVISION

public static final byte REVISION
See Also:
Constant Field Values
Constructor Detail

ID3v24Tag

public ID3v24Tag()
Creates a new empty ID3v2_4 datatype.


ID3v24Tag

public ID3v24Tag(ID3v24Tag copyObject)
Copy Constructor, creates a new ID3v2_4 Tag based on another ID3v2_4 Tag


ID3v24Tag

public ID3v24Tag(AbstractTag mp3tag)
Creates a new ID3v2_4 datatype based on another (non 2.4) tag

Parameters:
mp3tag -

ID3v24Tag

public ID3v24Tag(java.nio.ByteBuffer buffer,
                 java.lang.String loggingFilename)
          throws TagException
Creates a new ID3v2_4 datatype.

Parameters:
buffer -
loggingFilename -
Throws:
TagException

ID3v24Tag

public ID3v24Tag(java.nio.ByteBuffer buffer)
          throws TagException
Deprecated. use ID3v24Tag(ByteBuffer,String) instead

Creates a new ID3v2_4 datatype.

Parameters:
buffer -
Throws:
TagException
Method Detail

getRelease

public byte getRelease()
Retrieve the Release

Specified by:
getRelease in class AbstractID3Tag

getMajorVersion

public byte getMajorVersion()
Retrieve the Major Version

Specified by:
getMajorVersion in class AbstractID3Tag

getRevision

public byte getRevision()
Retrieve the Revision

Specified by:
getRevision in class AbstractID3Tag

getIdentifier

public java.lang.String getIdentifier()
Description copied from class: AbstractID3Tag
Get full version

Overrides:
getIdentifier in class AbstractID3Tag
Returns:
identifier

getSize

public 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.

Overrides:
getSize in class AbstractID3v2Tag
Returns:
size

equals

public boolean equals(java.lang.Object obj)
Description copied from class: AbstractID3v2Tag
Is this tag equivalent to another

Overrides:
equals in class AbstractID3v2Tag
Parameters:
obj -
Returns:
equality

read

public void read(java.nio.ByteBuffer byteBuffer)
          throws TagException
Read Tag from Specified file. Read tag header, delegate reading of frames to readFrames()

Specified by:
read in class AbstractTagItem
Parameters:
byteBuffer - to read the tag from
Throws:
TagException
TagNotFoundException
InvalidTagException

write

public void write(java.io.File file,
                  long audioStartLocation)
           throws java.io.IOException
Write this tag to file.

Overrides:
write in class AbstractID3v2Tag
Parameters:
file -
Throws:
java.io.IOException

write

public void write(java.nio.channels.WritableByteChannel channel)
           throws java.io.IOException
Write tag to channel

Overrides:
write in class AbstractID3v2Tag
Parameters:
channel -
Throws:
java.io.IOException

createStructure

public void createStructure()
Display the tag in an XMLFormat

Overrides:
createStructure in class AbstractID3v2Tag

isUnsynchronization

public boolean isUnsynchronization()
Are all frame swithin this tag unsynchronized

Because synchronization occurs at the frame level it is not normally desirable to unsynchronize all frames and hence this flag is not normally set.

Returns:
are all frames within the tag unsynchronized

createFrame

public ID3v24Frame createFrame(java.lang.String id)
Create a new frame with the specified frameid

Specified by:
createFrame in class AbstractID3v2Tag
Parameters:
id -
Returns:

createTagField

public TagField createTagField(ID3v24FieldKey id3Key,
                               java.lang.String value)
                        throws KeyNotFoundException,
                               FieldDataInvalidException
Create Frame for Id3 Key

Only textual data supported at the moment, should only be used with frames that support a simple string argument.

Parameters:
id3Key -
value -
Returns:
Throws:
KeyNotFoundException
FieldDataInvalidException

getFirst

public java.lang.String getFirst(ID3v24FieldKey id3v24FieldKey)
                          throws KeyNotFoundException
Retrieve the first value that exists for this id3v24key

Parameters:
id3v24FieldKey -
Returns:
Throws:
KeyNotFoundException

deleteTagField

public void deleteTagField(ID3v24FieldKey id3v24FieldKey)
                    throws KeyNotFoundException
Delete fields with this id3v24FieldKey

Parameters:
id3v24FieldKey -
Throws:
KeyNotFoundException