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

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyEQU2.java]

nameclass, %method, %block, %line, %
FrameBodyEQU2.java0%   (0/1)0%   (0/9)0%   (0/115)0%   (0/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyEQU20%   (0/1)0%   (0/9)0%   (0/115)0%   (0/30)
FrameBodyEQU2 (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyEQU2 (FrameBodyEQU2): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyEQU2 (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyEQU2 (byte, String, short, short): void 0%   (0/1)0%   (0/18)0%   (0/5)
addGroup (short, short): void 0%   (0/1)0%   (0/28)0%   (0/7)
getIdentifier (): String 0%   (0/1)0%   (0/10)0%   (0/1)
getOwner (): String 0%   (0/1)0%   (0/5)0%   (0/1)
getOwner (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/36)0%   (0/7)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.AbstractMP3Object;
5import org.farng.mp3.object.ObjectGroupRepeated;
6import org.farng.mp3.object.ObjectNumberFixedLength;
7import org.farng.mp3.object.ObjectNumberHashMap;
8import org.farng.mp3.object.ObjectStringNullTerminated;
9 
10import java.io.IOException;
11import java.io.RandomAccessFile;
12 
13/**
14 * <h3>4.12.&nbsp;&nbsp; Equalisation (2)</h3>
15 * <p/>
16 * <p>&nbsp;&nbsp; This is another subjective, alignment frame. It allows the user to<br>
17 * <p/>
18 * &nbsp;&nbsp; predefine an equalisation curve within the audio file. There may be<br> &nbsp;&nbsp; more than one
19 * &quot;EQU2&quot; frame in each tag, but only one with the same<br> &nbsp;&nbsp; identification string.</p>
20 * <p/>
21 * <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;Header of 'Equalisation (2)', ID: &quot;EQU2&quot;&gt;<br>
22 * <p/>
23 * &nbsp;&nbsp;&nbsp;&nbsp; Interpolation method&nbsp; $xx<br> &nbsp;&nbsp;&nbsp;&nbsp;
24 * Identification&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;text string&gt; $00</p>
25 * <p/>
26 * <p>&nbsp;&nbsp; The 'interpolation method' describes which method is preferred when<br>
27 * <p/>
28 * &nbsp;&nbsp; an interpolation between the adjustment point that follows. The<br> &nbsp;&nbsp; following methods are
29 * currently defined:</p>
30 * <p/>
31 * <p>&nbsp;&nbsp;&nbsp;&nbsp; $00&nbsp; Band<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; No
32 * interpolation is made. A jump from one adjustment level to<br>
33 * <p/>
34 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; another occurs in the middle between two adjustment
35 * points.<br> &nbsp;&nbsp;&nbsp;&nbsp; $01&nbsp; Linear<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
36 * Interpolation between adjustment points is linear.</p>
37 * <p/>
38 * <p>&nbsp;&nbsp; The 'identification' string is used to identify the situation and/or<br>
39 * <p/>
40 * &nbsp;&nbsp; device where this adjustment should apply. The following is then<br> &nbsp;&nbsp; repeated for every
41 * adjustment point</p>
42 * <p/>
43 * <p>&nbsp;&nbsp;&nbsp;&nbsp; Frequency&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx xx<br>
44 * &nbsp;&nbsp;&nbsp;&nbsp; Volume adjustment&nbsp; $xx xx</p>
45 * <p/>
46 * <p>&nbsp;&nbsp; The frequency is stored in units of 1/2 Hz, giving it a range from 0<br> &nbsp;&nbsp; to 32767
47 * Hz.</p>
48 * <p/>
49 * <p>&nbsp;&nbsp; The volume adjustment is encoded as a fixed point decibel value, 16<br> &nbsp;&nbsp; bit signed
50 * integer representing (adjustment*512), giving +/- 64 dB<br> &nbsp;&nbsp; with a precision of 0.001953125 dB. E.g. +2
51 * dB is stored as $04 00<br>
52 * <p/>
53 * &nbsp;&nbsp; and -2 dB is $FC 00.</p>
54 * <p/>
55 * <p>&nbsp;&nbsp; Adjustment points should be ordered by frequency and one frequency<br> &nbsp;&nbsp; should only be
56 * described once in the frame.<br> </p>
57 *
58 * @author Eric Farng
59 * @version $Revision: 1.5 $
60 */
61public class FrameBodyEQU2 extends AbstractID3v2FrameBody {
62 
63    /**
64     * Creates a new FrameBodyEQU2 object.
65     */
66    public FrameBodyEQU2() {
67        super();
68    }
69 
70    /**
71     * Creates a new FrameBodyEQU2 object.
72     */
73    public FrameBodyEQU2(final FrameBodyEQU2 body) {
74        super(body);
75    }
76 
77    /**
78     * Creates a new FrameBodyEQU2 object.
79     */
80    public FrameBodyEQU2(final byte interpolationMethod,
81                         final String owner,
82                         final short frequency,
83                         final short volumeAdjustment) {
84        setObject("Interpolation Method", new Byte(interpolationMethod));
85        setObject("Owner", owner);
86        this.addGroup(frequency, volumeAdjustment);
87    }
88 
89    /**
90     * Creates a new FrameBodyEQU2 object.
91     */
92    public FrameBodyEQU2(final RandomAccessFile file) throws IOException, InvalidTagException {
93        this.read(file);
94    }
95 
96    public String getIdentifier() {
97        return "EQU2" + ((char) 0) + getOwner();
98    }
99 
100    public String getOwner() {
101        return (String) getObject("Owner");
102    }
103 
104    public void getOwner(final String description) {
105        setObject("Owner", description);
106    }
107 
108    public void addGroup(final short frequency, final short volumeAdjustment) {
109        final ObjectGroupRepeated group = (ObjectGroupRepeated) this.getObject("Data");
110        final AbstractMP3Object freq = new ObjectNumberFixedLength("Frequency", 2);
111        final AbstractMP3Object volume = new ObjectNumberFixedLength("Volume Adjustment", 2);
112        group.addObject(freq);
113        group.addObject(volume);
114        setObject("Data", group);
115    }
116 
117    protected void setupObjectList() {
118        appendToObjectList(new ObjectNumberHashMap("Interpolation Method", 1));
119        appendToObjectList(new ObjectStringNullTerminated("Owner"));
120        final ObjectGroupRepeated group = new ObjectGroupRepeated("Data");
121        group.addProperty(new ObjectNumberFixedLength("Frequency", 2));
122        group.addProperty(new ObjectNumberFixedLength("Volume Adjustment", 2));
123        appendToObjectList(group);
124    }
125}

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