package org.farng.mp3.id3; import java.io.IOException; import java.io.RandomAccessFile; import org.farng.mp3.InvalidTagException; import org.farng.mp3.object.ObjectByteArraySizeTerminated; /** * <h3>4.4.   Music CD identifier</h3> * <p/> * <p>   This frame is intended for music that comes from a CD, so that the CD<br> * <p/> *    can be identified in databases such as the CDDB [CDDB]. The frame<br>    consists of a binary * dump of the Table Of Contents, TOC, from the CD,<br>    which is a header of 4 bytes and then 8 bytes/track * on the CD plus 8<br>    bytes for the 'lead out', making a maximum of 804 bytes. The offset<br> *    to the beginning of every track on the CD should be described with a<br> * <p/> *    four bytes absolute CD-frame address per track, and not with absolute<br>    time. When this * frame is used the presence of a valid "TRCK" frame is<br>    REQUIRED, even if the CD's only got * one track. It is recommended that<br>    this frame is always added to tags originating from CDs. There * may<br> * <p/> *    only be one "MCDI" frame in each tag.</p> * <p/> * <p>     <Header for 'Music CD identifier', ID: "MCDI"><br> *      CD TOC                * <binary data><br> * <p/> * </p> * * @author Eric Farng * @version $Revision: 2374 $ */ public class FrameBodyMCDI extends AbstractID3v2FrameBody { /** * Creates a new FrameBodyMCDI object. */ public FrameBodyMCDI() { super(); } /** * Creates a new FrameBodyMCDI object. */ public FrameBodyMCDI(final FrameBodyMCDI body) { super(body); } /** * Creates a new FrameBodyMCDI object. */ public FrameBodyMCDI(final byte[] cdTOC) { setObject("CD Table of Contents", cdTOC); } /** * Creates a new FrameBodyMCDI object. */ public FrameBodyMCDI(final RandomAccessFile file) throws IOException, InvalidTagException { this.read(file); } public String getIdentifier() { return "MCDI"; } protected void setupObjectList() { appendToObjectList(new ObjectByteArraySizeTerminated("CD Table of Contents")); } }