org.jaudiotagger.tag.id3.framebody
Class FrameBodyPIC

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.FrameBodyPIC
All Implemented Interfaces:
ID3v22FrameBody

public class FrameBodyPIC
extends AbstractID3v2FrameBody
implements ID3v22FrameBody

ID3v22 Attached Picture

This frame contains a picture directly related to the audio file. Image format is preferably "PNG" [PNG] or "JPG" [JFIF]. Description is a short description of the picture, represented as a terminated textstring. The description has a maximum length of 64 characters, but may be empty. There may be several pictures attached to one file, each in their individual "PIC" frame, but only one with the same ontent descriptor. There may only be one picture with the picture type declared as picture type $01 and $02 respectively. There is a possibility to put only a link to the image file by using the 'image format' "-->" and having a complete URL [URL] instead of picture data. The use of linked files should however be used restrictively since there is the risk of separation of files.

Attached picture "PIC" Frame size $xx xx xx Text encoding $xx Image format $xx xx xx Picture type $xx Description $00 (00) Picture data

Picture type: $00 Other $01 32x32 pixels 'file icon' (PNG only) $02 Other file icon $03 Cover (front) $04 Cover (back) $05 Leaflet page $06 Media (e.g. lable side of CD) $07 Lead artist/lead performer/soloist $08 Artist/performer $09 Conductor $0A Band/Orchestra $0B Composer $0C Lyricist/text writer $0D Recording Location $0E During recording $0F During performance $10 Movie/video screen capture $11 A bright coloured fish $12 Illustration $13 Band/artist logotype $14 Publisher/Studio logotype


Field Summary
static java.lang.String IMAGE_IS_URL
           
 
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
FrameBodyPIC()
          Creates a new FrameBodyPIC datatype.
FrameBodyPIC(java.nio.ByteBuffer byteBuffer, int frameSize)
          Creates a new FrameBodyPIC datatype.
FrameBodyPIC(byte textEncoding, java.lang.String imageFormat, byte pictureType, java.lang.String description, byte[] data)
          Creates a new FrameBodyPIC datatype.
FrameBodyPIC(FrameBodyAPIC body)
          Conversion from v2 PIC to v3/v4 APIC
FrameBodyPIC(FrameBodyPIC body)
           
 
Method Summary
 java.lang.String getDescription()
          Get a description of the image
 java.lang.String getFormatType()
          Get a description of the image
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
 byte[] getImageData()
          Get Image data
 int getPictureType()
           
 boolean isImageUrl()
           
 void setDescription(java.lang.String description)
          Set a description of the image
 void setImageData(byte[] imageData)
          Set imageData
 void setPictureType(byte pictureType)
          Set Picture Type
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)
          If the description cannot be encoded using current encoder, change the encoder
 
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

IMAGE_IS_URL

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

FrameBodyPIC

public FrameBodyPIC()
Creates a new FrameBodyPIC datatype.


FrameBodyPIC

public FrameBodyPIC(FrameBodyPIC body)

FrameBodyPIC

public FrameBodyPIC(byte textEncoding,
                    java.lang.String imageFormat,
                    byte pictureType,
                    java.lang.String description,
                    byte[] data)
Creates a new FrameBodyPIC datatype.

Parameters:
textEncoding -
imageFormat -
pictureType -
description -
data -

FrameBodyPIC

public FrameBodyPIC(FrameBodyAPIC body)
Conversion from v2 PIC to v3/v4 APIC

Parameters:
body -

FrameBodyPIC

public FrameBodyPIC(java.nio.ByteBuffer byteBuffer,
                    int frameSize)
             throws InvalidTagException
Creates a new FrameBodyPIC datatype.

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

setDescription

public void setDescription(java.lang.String description)
Set a description of the image

Parameters:
description - of the image

getDescription

public java.lang.String getDescription()
Get a description of the image

Returns:
a description of the image

setImageData

public void setImageData(byte[] imageData)
Set imageData

Parameters:
imageData -

getImageData

public byte[] getImageData()
Get Image data

Returns:

setPictureType

public void setPictureType(byte pictureType)
Set Picture Type

Parameters:
pictureType -

getPictureType

public int getPictureType()
Returns:
picturetype

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

write

public void write(java.io.ByteArrayOutputStream tagBuffer)
If the description cannot be encoded using current encoder, change the encoder

Overrides:
write in class AbstractID3v2FrameBody

getFormatType

public java.lang.String getFormatType()
Get a description of the image

Returns:
a description of the image

isImageUrl

public boolean isImageUrl()

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