org.jaudiotagger.tag.id3.framebody
Class FrameBodyCTOC

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

public class FrameBodyCTOC
extends AbstractID3v2FrameBody
implements ID3v2ChapterFrameBody

Table of content frame.

The purpose of "CTOC" frames is to allow a table of contents to be defined. In the simplest case, a single "CTOC" frame can be used to provide a flat (single-level) table of contents. However, multiple "CTOC" frames can also be used to define a hierarchical (multi-level) table of contents.

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 "CTOC" or "CHAP" frame in the tag.

Each "CTOC" frame represents one level or element of a table of contents by providing a list of Child Element IDs. These match the Element IDs of other "CHAP" and "CTOC" frames in the tag.

<ID3v2.3 or ID3v2.4 frame header, ID: "CTOC">  (10 bytes)
Element ID<text string> $00
Flags%000000ab
Entry count$xx  (8-bit unsigned int)
<Child Element ID list>
<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.

Flag a - Top-level bit
This is set to 1 to identify the top-level "CTOC" frame. This frame is the root of the Table of Contents tree and is not a child of any other "CTOC" frame. Only one "CTOC" frame in an ID3v2 tag can have this bit set to 1. In all other "CTOC" frames this bit shall be set to 0.

Flag b - Ordered bit
This should be set to 1 if the entries in the Child Element ID list are ordered or set to 0 if they not are ordered. This provides a hint as to whether the elements should be played as a continuous ordered sequence or played individually.

The Entry count is the number of entries in the Child Element ID list that follows and must be greater than zero. Each entry in the list consists of:

Child Element ID  <text string> $00

The last entry in the child Element ID list is followed by a sequence of optional frames that are embedded within the "CTOC" frame and which describe this element of the table of contents (e.g. a "TIT2" frame representing the name of the element) or provide related material such as URLs and images. These sub-frames are contained within the bounds of the "CTOC" frame as signalled by the size field in the "CTOC" frame header.

If a parser does not recognise "CTOC" 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: FrameBodyCTOC.java,v 1.7 2009/11/12 13:25:20 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
FrameBodyCTOC()
          Creates a new FrameBodyCTOC datatype.
FrameBodyCTOC(java.nio.ByteBuffer byteBuffer, int frameSize)
          Creates a new FrameBodyCTOC datatype.
FrameBodyCTOC(FrameBodyCTOC body)
          Creates a new FrameBodyCTOC datatype.
 
Method Summary
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
protected  void setupObjectList()
          TODO:proper mapping
 
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

FrameBodyCTOC

public FrameBodyCTOC()
Creates a new FrameBodyCTOC datatype.


FrameBodyCTOC

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

Parameters:
body -

FrameBodyCTOC

public FrameBodyCTOC(java.nio.ByteBuffer byteBuffer,
                     int frameSize)
              throws InvalidTagException
Creates a new FrameBodyCTOC 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()
TODO:proper mapping

Specified by:
setupObjectList in class AbstractTagFrameBody