org.jaudiotagger.tag.id3.framebody
Class FrameBodyCHAP

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.FrameBodyCHAP
All Implemented Interfaces:
ID3v2ChapterFrameBody

public class FrameBodyCHAP
extends AbstractID3v2FrameBody
implements ID3v2ChapterFrameBody

Chapter frame.

The purpose of this frame is to describe a single chapter within an audio file. There may be more than one frame of this type in a tag but each must have an Element ID that is unique with respect to any other "CHAP" frame or "CTOC" frame in the tag.

<ID3v2.3 or ID3v2.4 frame header, ID: "CHAP">  (10 bytes)
Element ID<text string> $00
Start time$xx xx xx xx
End time$xx xx xx xx
Start offset$xx xx xx xx
End offset$xx xx xx xx
<Optional embedded sub-frames>

The Element ID uniquely identifies the frame. It is not intended to be human readable and should not be presented to the end user.

The Start and End times are a count in milliseconds from the beginning of the file to the start and end of the chapter respectively.

The Start offset is a zero-based count of bytes from the beginning of the file to the first byte of the first audio frame in the chapter. If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized.

The End offset is a zero-based count of bytes from the beginning of the file to the first byte of the audio frame following the end of the chapter. If these bytes are all set to 0xFF then the value should be ignored and the end time value should be utilized.

There then follows a sequence of optional frames that are embedded within the "CHAP" frame and which describe the content of the chapter (e.g. a "TIT2" frame representing the chapter name) or provide related material such as URLs and images. These sub-frames are contained within the bounds of the "CHAP" frame as signalled by the size field in the "CHAP" frame header. If a parser does not recognise "CHAP" frames it can skip them using the size field in the frame header. When it does this it will skip any embedded sub-frames carried within the frame.

For more details, please refer to the ID3 Chapter Frame specifications:

Version:
$Id: FrameBodyCHAP.java,v 1.6 2009/11/12 13:25:22 paultaylor Exp $
Author:
Marc Gimpel, Horizon Wimba S.A.

Field Summary
 
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
FrameBodyCHAP()
          Creates a new FrameBodyCHAP datatype.
FrameBodyCHAP(java.nio.ByteBuffer byteBuffer, int frameSize)
          Creates a new FrameBodyAENC datatype.
FrameBodyCHAP(FrameBodyCHAP body)
          Creates a new FrameBodyCHAP datatype.
FrameBodyCHAP(java.lang.String elementId, int startTime, int endTime, int startOffset, int endOffset)
          Creates a new FrameBodyCHAP datatype.
 
Method Summary
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
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
 
Methods inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
createStructure, equals, getSize, read, setSize, setSize, write
 
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
 

Constructor Detail

FrameBodyCHAP

public FrameBodyCHAP()
Creates a new FrameBodyCHAP datatype.


FrameBodyCHAP

public FrameBodyCHAP(FrameBodyCHAP body)
Creates a new FrameBodyCHAP datatype.

Parameters:
body -

FrameBodyCHAP

public FrameBodyCHAP(java.lang.String elementId,
                     int startTime,
                     int endTime,
                     int startOffset,
                     int endOffset)
Creates a new FrameBodyCHAP datatype.

Parameters:
elementId -
startTime -
endTime -
startOffset -
endOffset -

FrameBodyCHAP

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

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

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

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