org.jaudiotagger.tag.mp4.field
Class Mp4TagCoverField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
      extended by org.jaudiotagger.tag.mp4.field.Mp4TagBinaryField
          extended by org.jaudiotagger.tag.mp4.field.Mp4TagCoverField
All Implemented Interfaces:
TagField

public class Mp4TagCoverField
extends Mp4TagBinaryField

Represents Cover Art

Note:Within this library we have a seperate TagCoverField for every image stored, however this does not map very directly to how they are physically stored within a file, because all are stored under a single covr atom, so a more complex conversion has to be done then for other fields when writing multiple images back to file.


Field Summary
private  int dataAndHeaderSize
           
private  Mp4FieldType imageType
           
 
Fields inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagBinaryField
dataBytes, dataSize, isBinary
 
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
id, logger, parentHeader
 
Constructor Summary
Mp4TagCoverField()
          Empty CoverArt Field
Mp4TagCoverField(byte[] data)
          Construct new cover art with binarydata provided

Identifies the imageType by looking at the data

Mp4TagCoverField(java.nio.ByteBuffer raw, Mp4FieldType imageType)
          Construct CoverField by reading data from audio file
 
Method Summary
protected  void build(java.nio.ByteBuffer raw)
          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.
 int getDataAndHeaderSize()
           
 Mp4FieldType getFieldType()
          Return field type, for artwork this also identifies the imagetype
static java.lang.String getMimeTypeForImageType(Mp4FieldType imageType)
           
 boolean isBinary()
          Determines whether the represented field contains (is made up of) binary data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false.
 java.lang.String toString()
          This method returns a human readable description of the fields contents.
For text fields it should be the text itself.
 
Methods inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagBinaryField
copyContent, getData, getDataBytes, getDataSize, isEmpty, setData
 
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
 

Field Detail

imageType

private Mp4FieldType imageType

dataAndHeaderSize

private int dataAndHeaderSize
Constructor Detail

Mp4TagCoverField

public Mp4TagCoverField()
Empty CoverArt Field


Mp4TagCoverField

public Mp4TagCoverField(java.nio.ByteBuffer raw,
                        Mp4FieldType imageType)
                 throws java.io.UnsupportedEncodingException
Construct CoverField by reading data from audio file

Parameters:
raw -
imageType -
Throws:
java.io.UnsupportedEncodingException

Mp4TagCoverField

public Mp4TagCoverField(byte[] data)
Construct new cover art with binarydata provided

Identifies the imageType by looking at the data

Parameters:
data -
Throws:
java.io.UnsupportedEncodingException
Method Detail

getDataAndHeaderSize

public int getDataAndHeaderSize()
Returns:
data and header size

getFieldType

public Mp4FieldType getFieldType()
Return field type, for artwork this also identifies the imagetype

Overrides:
getFieldType in class Mp4TagBinaryField
Returns:
field type

isBinary

public boolean isBinary()
Description copied from interface: TagField
Determines whether the represented field contains (is made up of) binary data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false.

Specified by:
isBinary in interface TagField
Overrides:
isBinary in class Mp4TagBinaryField
Returns:
true if field represents binary data (not human readable).

toString

public java.lang.String toString()
Description copied from interface: TagField
This method returns a human readable description of the fields contents.
For text fields it should be the text itself. Other fields containing images may return a formatted string with image properties like width, height and so on.

Specified by:
toString in interface TagField
Overrides:
toString in class java.lang.Object
Returns:
Description of the fields content.

build

protected void build(java.nio.ByteBuffer raw)
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 Mp4TagBinaryField

getMimeTypeForImageType

public static java.lang.String getMimeTypeForImageType(Mp4FieldType imageType)
Parameters:
imageType -
Returns:
the corresponding mimetype