EMMA Coverage Report (generated Tue Mar 14 21:50:42 EST 2006)
[all classes][org.farng.mp3.id3]

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyPIC.java]

nameclass, %method, %block, %line, %
FrameBodyPIC.java0%   (0/1)0%   (0/8)0%   (0/95)0%   (0/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyPIC0%   (0/1)0%   (0/8)0%   (0/95)0%   (0/24)
FrameBodyPIC (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyPIC (FrameBodyPIC): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyPIC (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyPIC (byte, String, byte, String, byte []): void 0%   (0/1)0%   (0/29)0%   (0/7)
getDescription (): String 0%   (0/1)0%   (0/5)0%   (0/1)
getIdentifier (): String 0%   (0/1)0%   (0/10)0%   (0/1)
setDescription (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/33)0%   (0/6)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.ObjectByteArraySizeTerminated;
5import org.farng.mp3.object.ObjectNumberHashMap;
6import org.farng.mp3.object.ObjectStringNullTerminated;
7 
8import java.io.IOException;
9import java.io.RandomAccessFile;
10 
11/**
12 * <h3>4.15. Attached picture</h3>
13 * <p/>
14 * <p class=t> This frame contains a picture directly related to the audio file. Image format is preferably "<a
15 * href="#png">PNG</a>" or "<a href="#jfif">JPG</a>". <i>Since JPG has the best lossy compression and PNG the best
16 * lossless compression and both are free I don't see much room for other formats. I didn't want to forbid other formats
17 * though, since there might pop up better ones in the future. Some people will probably think it is neat with ICO
18 * pictures as well.</i> Description is a short description of the picture, represented as a terminated textstring. The
19 * description has a maximum length of 64 characters, but may be empty. There may be several pictures attached to one
20 * file, each in their individual "PIC" frame, but only one with the same content descriptor. There may only be one
21 * picture with the picture type declared as picture type $01 and $02 respectively. There is a possibility to put only a
22 * link to the image file by using the 'image format' "--&gt;" and having a complete URL instead of picture data. The
23 * use of linked files should however be used restrictively since there is the risk of separation of files.
24 * <p/>
25 * </p>
26 * <p/>
27 * <p><center> <table border=0> <tr><td nowrap>Attached picture</td><td rowspan=7>&nbsp;</td><td
28 * width="100%">"PIC"</td></tr> <tr><td>Frame size</td><td>$xx xx xx</td></tr> <tr><td>Text
29 * encoding</td><td>$xx</td></tr>
30 * <p/>
31 * <tr><td>Image format</td><td>$xx xx xx</td></tr> <tr><td>Picture type</td><td>$xx</td></tr>
32 * <tr><td>Description</td><td>&lt;textstring&gt; $00 (00)</td></tr> <tr><td>Picture data</td><td>&lt;binary
33 * data&gt;</td></tr>
34 * <p/>
35 * </table> </center>
36 * <p/>
37 * <p><center> <table border=0> <tr valign=top><td rowspan=21 nowrap>Picture type:&nbsp;</td><td width="100%">$00 &nbsp;
38 * Other</td></tr> <tr><td>$01 &nbsp; 32x32 pixels 'file icon' (<a href="#png">PNG</a> only)</td></tr>
39 * <p/>
40 * <tr><td>$02 &nbsp; Other file icon</td></tr> <tr><td>$03 &nbsp; Cover (front)</td></tr> <tr><td>$04 &nbsp; Cover
41 * (back)</td></tr> <tr><td>$05 &nbsp; Leaflet page</td></tr>
42 * <p/>
43 * <tr><td>$06 &nbsp; Media (e.g. lable side of CD)</td></tr> <tr><td>$07 &nbsp; Lead artist/lead
44 * performer/soloist</td></tr> <tr><td>$08 &nbsp; Artist/performer</td></tr> <tr><td>$09 &nbsp; Conductor</td></tr>
45 * <p/>
46 * <tr><td>$0A &nbsp; Band/Orchestra</td></tr> <tr><td>$0B &nbsp; Composer</td></tr> <tr><td>$0C &nbsp; Lyricist/text
47 * writer</td></tr> <tr><td>$0D &nbsp; Recording Location</td></tr>
48 * <p/>
49 * <tr><td>$0E &nbsp; During recording</td></tr> <tr><td>$0F &nbsp; During performance</td></tr> <tr><td>$10 &nbsp;
50 * Movie/video screen capture</td></tr> <tr><td>$11 &nbsp; A bright coloured fish</td></tr>
51 * <p/>
52 * <tr><td>$12 &nbsp; Illustration</td></tr> <tr><td>$13 &nbsp; Band/artist logotype</td></tr> <tr><td>$14 &nbsp;
53 * Publisher/Studio logotype</td></tr> </table>
54 * <p/>
55 * </center>
56 *
57 * @author Eric Farng
58 * @version $Revision: 1.4 $
59 */
60public class FrameBodyPIC extends AbstractID3v2FrameBody {
61 
62    /**
63     * Creates a new FrameBodyPIC object.
64     */
65    public FrameBodyPIC() {
66        super();
67    }
68 
69    /**
70     * Creates a new FrameBodyPIC object.
71     */
72    public FrameBodyPIC(final FrameBodyPIC body) {
73        super(body);
74    }
75 
76    /**
77     * Creates a new FrameBodyPIC object.
78     */
79    public FrameBodyPIC(final byte textEncoding,
80                        final String imageFormat,
81                        final byte pictureType,
82                        final String description,
83                        final byte[] data) {
84        setObject("Text Encoding", new Byte(textEncoding));
85        setObject("Image Format", imageFormat);
86        setObject("Picture Type", new Byte(pictureType));
87        setObject("Description", description);
88        setObject("Picture Data", data);
89    }
90 
91    /**
92     * Creates a new FrameBodyPIC object.
93     */
94    public FrameBodyPIC(final RandomAccessFile file) throws IOException, InvalidTagException {
95        this.read(file);
96    }
97 
98    public void setDescription(final String description) {
99        setObject("Description", description);
100    }
101 
102    public String getDescription() {
103        return (String) getObject("Description");
104    }
105 
106    public String getIdentifier() {
107        return "PIC" + ((char) 0) + getDescription();
108    }
109 
110    protected void setupObjectList() {
111        appendToObjectList(new ObjectNumberHashMap(ObjectNumberHashMap.TEXT_ENCODING, 1));
112        appendToObjectList(new ObjectStringNullTerminated("Image Format"));
113        appendToObjectList(new ObjectNumberHashMap(ObjectNumberHashMap.PICTURE_TYPE, 3));
114        appendToObjectList(new ObjectStringNullTerminated("Description"));
115        appendToObjectList(new ObjectByteArraySizeTerminated("Picture Data"));
116    }
117}

[all classes][org.farng.mp3.id3]
EMMA 2.0.5312 (C) Vladimir Roubtsov