org.jaudiotagger.tag.mp4.field
Class Mp4GenreField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
      extended by org.jaudiotagger.tag.mp4.field.Mp4TagTextField
          extended by org.jaudiotagger.tag.mp4.field.Mp4TagTextNumberField
              extended by org.jaudiotagger.tag.mp4.field.Mp4GenreField
All Implemented Interfaces:
TagField, TagTextField

public class Mp4GenreField
extends Mp4TagTextNumberField

Represents the Genre field , when user has selected from the set list of genres

This class allows you to retrieve either the internal genreid, or the display value


Field Summary
 
Fields inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextNumberField
NUMBER_LENGTH, numbers
 
Fields inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextField
content, dataSize
 
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
id, logger, parentHeader
 
Constructor Summary
Mp4GenreField(java.lang.String genreId)
          Construct genre, if cant find match just default to first genre
Mp4GenreField(java.lang.String id, java.nio.ByteBuffer data)
           
 
Method Summary
protected  void build(java.nio.ByteBuffer data)
          Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field.
static boolean isValidGenre(java.lang.String genreId)
          Precheck to see if the value is a valid genre or whether you should use a custom genre.
 
Methods inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextNumberField
copyContent, getDataBytes, getFieldType, getNumbers
 
Methods inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextField
getContent, getEncoding, isBinary, isEmpty, setContent, setEncoding, toString
 
Methods inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
getId, getIdBytes, getRawContent, getRawContentDataOnly, isBinary, isCommon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.TagField
getId, getRawContent, isBinary, isCommon
 

Constructor Detail

Mp4GenreField

public Mp4GenreField(java.lang.String id,
                     java.nio.ByteBuffer data)
              throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

Mp4GenreField

public Mp4GenreField(java.lang.String genreId)
Construct genre, if cant find match just default to first genre

Parameters:
genreId - key into ID3v1 list (offset by one) or String value in ID3list
Method Detail

isValidGenre

public static boolean isValidGenre(java.lang.String genreId)
Precheck to see if the value is a valid genre or whether you should use a custom genre.

Parameters:
genreId -
Returns:

build

protected void build(java.nio.ByteBuffer data)
              throws java.io.UnsupportedEncodingException
Description copied from class: Mp4TagField
Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field.

Overrides:
build in class Mp4TagTextNumberField
Throws:
java.io.UnsupportedEncodingException