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

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyUSLT.java]

nameclass, %method, %block, %line, %
FrameBodyUSLT.java100% (1/1)71%  (10/14)79%  (104/132)72%  (23/32)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyUSLT100% (1/1)71%  (10/14)79%  (104/132)72%  (23/32)
FrameBodyUSLT (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
addLyric (String): void 0%   (0/1)0%   (0/12)0%   (0/2)
setDescription (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setLanguage (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
FrameBodyUSLT (): void 100% (1/1)100% (3/3)100% (2/2)
FrameBodyUSLT (FrameBodyUSLT): void 100% (1/1)100% (4/4)100% (2/2)
FrameBodyUSLT (byte, String, String, String): void 100% (1/1)100% (22/22)100% (6/6)
addLyric (ObjectLyrics3Line): void 100% (1/1)100% (13/13)100% (2/2)
getDescription (): String 100% (1/1)100% (5/5)100% (1/1)
getIdentifier (): String 100% (1/1)100% (15/15)100% (1/1)
getLanguage (): String 100% (1/1)100% (5/5)100% (1/1)
getLyric (): String 100% (1/1)100% (5/5)100% (1/1)
setLyric (String): void 100% (1/1)100% (5/5)100% (2/2)
setupObjectList (): void 100% (1/1)100% (27/27)100% (5/5)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.ObjectLyrics3Line;
5import org.farng.mp3.object.ObjectNumberHashMap;
6import org.farng.mp3.object.ObjectStringHashMap;
7import org.farng.mp3.object.ObjectStringNullTerminated;
8import org.farng.mp3.object.ObjectStringSizeTerminated;
9 
10import java.io.IOException;
11import java.io.RandomAccessFile;
12 
13/**
14 * <h3>4.8.&nbsp;&nbsp; Unsynchronised lyrics/text transcription</h3>
15 * <p/>
16 * <p>&nbsp;&nbsp; This frame contains the lyrics of the song or a text transcription of<br> &nbsp;&nbsp; other vocal
17 * activities. The head includes an encoding descriptor and<br>
18 * <p/>
19 * &nbsp;&nbsp; a content descriptor. The body consists of the actual text. The<br> &nbsp;&nbsp; 'Content descriptor' is
20 * a terminated string. If no descriptor is<br> &nbsp;&nbsp; entered, 'Content descriptor' is $00 (00) only. Newline
21 * characters<br> &nbsp;&nbsp; are allowed in the text. There may be more than one 'Unsynchronised<br> &nbsp;&nbsp;
22 * lyrics/text transcription' frame in each tag, but only one with the<br>
23 * <p/>
24 * &nbsp;&nbsp; same language and content descriptor.</p>
25 * <p/>
26 * <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;Header for 'Unsynchronised lyrics/text transcription', ID: &quot;USLT&quot;&gt;<br>
27 * &nbsp;&nbsp;&nbsp;&nbsp; Text encoding&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx<br> &nbsp;&nbsp;&nbsp;&nbsp;
28 * <p/>
29 * Language&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx xx xx<br>
30 * &nbsp;&nbsp;&nbsp;&nbsp; Content descriptor&nbsp;&nbsp; &lt;text string according to encoding&gt; $00 (00)<br>
31 * &nbsp;&nbsp;&nbsp;&nbsp; Lyrics/text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;full text string
32 * according to encoding&gt;<br>
33 * <p/>
34 * </p>
35 *
36 * @author Eric Farng
37 * @version $Revision: 1.4 $
38 */
39public class FrameBodyUSLT extends AbstractID3v2FrameBody {
40 
41    /**
42     * Creates a new FrameBodyUSLT object.
43     */
44    public FrameBodyUSLT() {
45        super();
46    }
47 
48    /**
49     * Creates a new FrameBodyUSLT object.
50     */
51    public FrameBodyUSLT(final FrameBodyUSLT body) {
52        super(body);
53    }
54 
55    /**
56     * Creates a new FrameBodyUSLT object.
57     */
58    public FrameBodyUSLT(final byte textEncoding, final String language, final String description, final String text) {
59        setObject("Text Encoding", new Byte(textEncoding));
60        setObject("Language", language);
61        setObject("Description", description);
62        setObject("Lyrics/Text", text);
63    }
64 
65    /**
66     * Creates a new FrameBodyUSLT object.
67     */
68    public FrameBodyUSLT(final RandomAccessFile file) throws IOException, InvalidTagException {
69        this.read(file);
70    }
71 
72    public void setDescription(final String description) {
73        setObject("Description", description);
74    }
75 
76    public String getDescription() {
77        return (String) getObject("Description");
78    }
79 
80    public String getIdentifier() {
81        return "USLT" + ((char) 0) + getLanguage() + ((char) 0) + getDescription();
82    }
83 
84    public void setLanguage(final String language) {
85        setObject("Language", language);
86    }
87 
88    public String getLanguage() {
89        return (String) getObject("Language");
90    }
91 
92    public void setLyric(final String lyric) {
93        setObject("Lyrics/Text", lyric);
94    }
95 
96    public String getLyric() {
97        return (String) getObject("Lyrics/Text");
98    }
99 
100    public void addLyric(final String text) {
101        setLyric(getLyric() + text);
102    }
103 
104    public void addLyric(final ObjectLyrics3Line line) {
105        setLyric(getLyric() + line.writeString());
106    }
107 
108    protected void setupObjectList() {
109        appendToObjectList(new ObjectNumberHashMap("Text Encoding", 1));
110        appendToObjectList(new ObjectStringHashMap("Language", 3));
111        appendToObjectList(new ObjectStringNullTerminated("Description"));
112        appendToObjectList(new ObjectStringSizeTerminated("Lyrics/Text"));
113    }
114}

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