org.jaudiotagger.tag.id3
Class ID3v23Tag

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.ID3v23Tag
All Implemented Interfaces:
Tag

public class ID3v23Tag
extends AbstractID3v2Tag

Represents an ID3v2.3 tag.

Version:
$Id: ID3v23Tag.java,v 1.31 2007/11/13 14:24:31 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Field Summary
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
           
 
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
ID3v23Tag()
          Creates a new empty ID3v2_3 datatype.
ID3v23Tag(AbstractTag mp3tag)
          Constructs a new tag based upon another tag of different version/type
ID3v23Tag(java.nio.ByteBuffer buffer)
          Deprecated. use ID3v23Tag(ByteBuffer,String) instead
ID3v23Tag(java.nio.ByteBuffer buffer, java.lang.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
 
Method Summary
 ID3v23Frame createFrame(java.lang.String id)
          Create Frame of correct ID3 version with the specified id
 void createStructure()
          For representing the MP3File in an XML Format
 TagField createTagField(ID3v23FieldKey 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(ID3v23FieldKey id3v23FieldKey)
          Delete fields with this id3v23FieldKey
 boolean equals(java.lang.Object obj)
          Is Tag Equivalent to another tag
 java.lang.String getFirst(ID3v23FieldKey id3v23FieldKey)
          Retrieve the first value that exists for this id3v23key
 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 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.
 boolean isUnsynchronization()
           
 void read(java.nio.ByteBuffer buffer)
          Read tag from File
 void write(java.io.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(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, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.Tag
toString
 

Field Detail

MASK_V23_UNSYNCHRONIZATION

public static final int MASK_V23_UNSYNCHRONIZATION
ID3v2.3 Header bit mask

See Also:
Constant Field Values

MASK_V23_EXTENDED_HEADER

public static final int MASK_V23_EXTENDED_HEADER
ID3v2.3 Header bit mask

See Also:
Constant Field Values

MASK_V23_EXPERIMENTAL

public static final int MASK_V23_EXPERIMENTAL
ID3v2.3 Header bit mask

See Also:
Constant Field Values

MASK_V23_CRC_DATA_PRESENT

public static final int MASK_V23_CRC_DATA_PRESENT
ID3v2.3 Extended Header bit mask

See Also:
Constant Field Values

MASK_V23_EMBEDDED_INFO_FLAG

public static final int MASK_V23_EMBEDDED_INFO_FLAG
ID3v2.3 RBUF frame 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

ID3v23Tag

public ID3v23Tag()
Creates a new empty ID3v2_3 datatype.


ID3v23Tag

public ID3v23Tag(ID3v23Tag copyObject)
Copy Constructor, creates a new ID3v2_3 Tag based on another ID3v2_3 Tag


ID3v23Tag

public ID3v23Tag(AbstractTag mp3tag)
Constructs a new tag based upon another tag of different version/type


ID3v23Tag

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

Parameters:
buffer -
loggingFilename -
Throws:
TagException

ID3v23Tag

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

Creates a new ID3v2_3 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:
textual tag identifier

getSize

public 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. TODO this is incorrect, because of subclasses

Overrides:
getSize in class AbstractID3v2Tag
Returns:
size of tag

equals

public boolean equals(java.lang.Object obj)
Is Tag Equivalent to another tag

Overrides:
equals in class AbstractID3v2Tag
Parameters:
obj -
Returns:
true if tag is equivalent to another

read

public void read(java.nio.ByteBuffer buffer)
          throws TagException
Read tag from File

Specified by:
read in class AbstractTagItem
Parameters:
buffer - The buffer to read the ID3v23 Tag from
Throws:
TagException - on any exception generated by this library.

write

public void write(java.io.File file,
                  long audioStartLocation)
           throws java.io.IOException
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

Overrides:
write in class AbstractID3v2Tag
Parameters:
file - The file to write to
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()
For representing the MP3File in an XML Format

Overrides:
createStructure in class AbstractID3v2Tag

isUnsynchronization

public boolean isUnsynchronization()
Returns:
is tag unsynchronized

createFrame

public ID3v23Frame createFrame(java.lang.String id)
Description copied from class: AbstractID3v2Tag
Create Frame of correct ID3 version with the specified id

Specified by:
createFrame in class AbstractID3v2Tag
Returns:

createTagField

public TagField createTagField(ID3v23FieldKey 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(ID3v23FieldKey id3v23FieldKey)
                          throws KeyNotFoundException
Retrieve the first value that exists for this id3v23key

Parameters:
id3v23FieldKey -
Returns:
Throws:
KeyNotFoundException

deleteTagField

public void deleteTagField(ID3v23FieldKey id3v23FieldKey)
                    throws KeyNotFoundException
Delete fields with this id3v23FieldKey

Parameters:
id3v23FieldKey -
Throws:
KeyNotFoundException