org.jaudiotagger.tag.id3.framebody
Class FrameBodyCOMM

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTagFrameBody
          extended by org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
              extended by org.jaudiotagger.tag.id3.framebody.FrameBodyCOMM
All Implemented Interfaces:
ID3v23FrameBody, ID3v24FrameBody

public class FrameBodyCOMM
extends AbstractID3v2FrameBody
implements ID3v24FrameBody, ID3v23FrameBody

Comments frame.

This frame is intended for any kind of full text information that does not fit in any other frame. It consists of a frame header followed by encoding, language and content descriptors and is ended with the actual comment as a text string. Newline characters are allowed in the comment text string. There may be more than one comment frame in each tag, but only one with the same language and* content descriptor.

<Header for 'Comment', ID: "COMM">
Text encoding $xx
Language $xx xx xx
Short content descrip.<text string according to encoding> $00 (00)
The actual text <full text string according to encoding>

For more details, please refer to the ID3 specifications:

Version:
$Id: FrameBodyCOMM.java 926 2010-10-21 15:49:06Z paultaylor $
Author:
: Paul Taylor, : Eric Farng

Field Summary
static java.lang.String DEFAULT
           
static java.lang.String ITUNES_NORMALIZATION
           
static java.lang.String MM_CUSTOM1
           
static java.lang.String MM_CUSTOM2
           
static java.lang.String MM_CUSTOM3
           
static java.lang.String MM_CUSTOM4
           
static java.lang.String MM_CUSTOM5
           
static java.lang.String MM_OCCASION
           
private static java.lang.String MM_PREFIX
           
static java.lang.String MM_QUALITY
           
static java.lang.String MM_TEMPO
           
 
Fields inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
TYPE_BODY
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
objectList
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
logger
 
Constructor Summary
FrameBodyCOMM()
          Creates a new FrameBodyCOMM datatype.
FrameBodyCOMM(java.nio.ByteBuffer byteBuffer, int frameSize)
          Construct a Comment frame body from the buffer
FrameBodyCOMM(byte textEncoding, java.lang.String language, java.lang.String description, java.lang.String text)
          Creates a new FrameBodyCOMM datatype.
FrameBodyCOMM(FrameBodyCOMM body)
           
 
Method Summary
 java.lang.String getDescription()
          Get the description field, which describes the type of comment
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
 java.lang.String getLanguage()
          Get the language the comment is written in
 java.lang.String getText()
          Returns the the text field which holds the comment, adjusted to ensure does not return trailing null which is due to a iTunes bug.
 java.lang.String getUserFriendlyValue()
           
 boolean isItunesFrame()
           
 boolean isMediaMonkeyFrame()
           
 void setDescription(java.lang.String description)
          Set the description field, which describes the type of comment
 void setLanguage(java.lang.String language)
          Sets the language the comment is written in
 void setText(java.lang.String text)
           
protected  void setupObjectList()
          Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses
 void write(java.io.ByteArrayOutputStream tagBuffer)
          Because COMM have a text encoding we need to check the text String does not contain characters that cannot be encoded in current encoding before we write data.
 
Methods inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
createStructure, equals, getSize, read, setSize, setSize
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final java.lang.String DEFAULT
See Also:
Constant Field Values

ITUNES_NORMALIZATION

public static final java.lang.String ITUNES_NORMALIZATION
See Also:
Constant Field Values

MM_PREFIX

private static final java.lang.String MM_PREFIX
See Also:
Constant Field Values

MM_CUSTOM1

public static final java.lang.String MM_CUSTOM1
See Also:
Constant Field Values

MM_CUSTOM2

public static final java.lang.String MM_CUSTOM2
See Also:
Constant Field Values

MM_CUSTOM3

public static final java.lang.String MM_CUSTOM3
See Also:
Constant Field Values

MM_CUSTOM4

public static final java.lang.String MM_CUSTOM4
See Also:
Constant Field Values

MM_CUSTOM5

public static final java.lang.String MM_CUSTOM5
See Also:
Constant Field Values

MM_OCCASION

public static final java.lang.String MM_OCCASION
See Also:
Constant Field Values

MM_QUALITY

public static final java.lang.String MM_QUALITY
See Also:
Constant Field Values

MM_TEMPO

public static final java.lang.String MM_TEMPO
See Also:
Constant Field Values
Constructor Detail

FrameBodyCOMM

public FrameBodyCOMM()
Creates a new FrameBodyCOMM datatype.


FrameBodyCOMM

public FrameBodyCOMM(FrameBodyCOMM body)

FrameBodyCOMM

public FrameBodyCOMM(byte textEncoding,
                     java.lang.String language,
                     java.lang.String description,
                     java.lang.String text)
Creates a new FrameBodyCOMM datatype.

Parameters:
textEncoding -
language -
description -
text -

FrameBodyCOMM

public FrameBodyCOMM(java.nio.ByteBuffer byteBuffer,
                     int frameSize)
              throws InvalidTagException
Construct a Comment frame body from the buffer

Parameters:
byteBuffer -
frameSize -
Throws:
InvalidTagException - if unable to create framebody from buffer
Method Detail

isMediaMonkeyFrame

public boolean isMediaMonkeyFrame()

isItunesFrame

public boolean isItunesFrame()

setDescription

public void setDescription(java.lang.String description)
Set the description field, which describes the type of comment

Parameters:
description -

getDescription

public java.lang.String getDescription()
Get the description field, which describes the type of comment

Returns:
description field

getIdentifier

public java.lang.String getIdentifier()
The ID3v2 frame identifier

Specified by:
getIdentifier in class AbstractID3v2FrameBody
Returns:
the ID3v2 frame identifier for this frame type

setLanguage

public void setLanguage(java.lang.String language)
Sets the language the comment is written in

Parameters:
language -

getLanguage

public java.lang.String getLanguage()
Get the language the comment is written in

Returns:
the language

setText

public void setText(java.lang.String text)
Parameters:
text -

getText

public java.lang.String getText()
Returns the the text field which holds the comment, adjusted to ensure does not return trailing null which is due to a iTunes bug.

Returns:
the text field

getUserFriendlyValue

public java.lang.String getUserFriendlyValue()
Overrides:
getUserFriendlyValue in class AbstractTagFrameBody
Returns:
the text value that the user would expect to see for this framebody type, this should be overrridden for all framebodies

setupObjectList

protected void setupObjectList()
Description copied from class: AbstractTagFrameBody
Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses

Specified by:
setupObjectList in class AbstractTagFrameBody

write

public void write(java.io.ByteArrayOutputStream tagBuffer)
Because COMM have a text encoding we need to check the text String does not contain characters that cannot be encoded in current encoding before we write data. If there are we change the encoding.

Overrides:
write in class AbstractID3v2FrameBody


Copyright © 2005-2010 java.net. All Rights Reserved.