~ubuntu-branches/ubuntu/utopic/libjaudiotagger-java/utopic

« back to all changes in this revision

Viewing changes to src/org/jaudiotagger/tag/id3/framebody/FrameBodyEQU2.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2011-04-28 23:52:43 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110428235243-pzalvw6lncis3ukf
Tags: 2.0.3-1
* d/control: Drop Depends on default-jre per Debian Java Policy as its
  a library package.
* d/watch: Fix to directly monitor SVN tags.
* Switch to 3.0 (quilt) format.
* Bump Standards-Version to 3.9.2 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 *  @author : Paul Taylor
3
 
 *  @author : Eric Farng
4
 
 *
5
 
 *  Version @version:$Id: FrameBodyEQU2.java,v 1.15 2009/11/12 13:25:19 paultaylor Exp $
6
 
 *
7
 
 *  MusicTag Copyright (C)2003,2004
8
 
 *
9
 
 *  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
10
 
 *  General Public  License as published by the Free Software Foundation; either version 2.1 of the License,
11
 
 *  or (at your option) any later version.
12
 
 *
13
 
 *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
14
 
 *  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
 
 *  See the GNU Lesser General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU Lesser General Public License along with this library; if not,
18
 
 *  you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
19
 
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
 
 *
21
 
 * Description:
22
 
 *
23
 
 */
24
 
package org.jaudiotagger.tag.id3.framebody;
25
 
 
26
 
import org.jaudiotagger.tag.InvalidTagException;
27
 
import org.jaudiotagger.tag.datatype.ByteArraySizeTerminated;
28
 
import org.jaudiotagger.tag.datatype.DataTypes;
29
 
import org.jaudiotagger.tag.id3.ID3v24Frames;
30
 
 
31
 
import java.nio.ByteBuffer;
32
 
 
33
 
 
34
 
/**
35
 
 * Equalisation (2)
36
 
 * <p/>
37
 
 * This is another subjective, alignment frame. It allows the user to
38
 
 * predefine an equalisation curve within the audio file. There may be
39
 
 * more than one "EQU2" frame in each tag, but only one with the same
40
 
 * identification string.
41
 
 * <p/>
42
 
 * <Header of 'Equalisation (2)', ID: "EQU2">
43
 
 * Interpolation method  $xx
44
 
 * Identification        <text string> $00
45
 
 * <p/>
46
 
 * The 'interpolation method' describes which method is preferred when
47
 
 * an interpolation between the adjustment point that follows. The
48
 
 * following methods are currently defined:
49
 
 * <p/>
50
 
 * $00  Band
51
 
 * No interpolation is made. A jump from one adjustment level to
52
 
 * another occurs in the middle between two adjustment points.
53
 
 * $01  Linear
54
 
 * Interpolation between adjustment points is linear.
55
 
 * <p/>
56
 
 * The 'identification' string is used to identify the situation and/or
57
 
 * device where this adjustment should apply. The following is then
58
 
 * repeated for every adjustment point
59
 
 * <p/>
60
 
 * Frequency          $xx xx
61
 
 * Volume adjustment  $xx xx
62
 
 * <p/>
63
 
 * The frequency is stored in units of 1/2 Hz, giving it a range from 0
64
 
 * to 32767 Hz.
65
 
 * <p/>
66
 
 * The volume adjustment is encoded as a fixed point decibel value, 16
67
 
 * bit signed integer representing (adjustment*512), giving +/- 64 dB
68
 
 * with a precision of 0.001953125 dB. E.g. +2 dB is stored as $04 00
69
 
 * and -2 dB is $FC 00.
70
 
 * <p/>
71
 
 * Adjustment points should be ordered by frequency and one frequency
72
 
 * should only be described once in the frame.
73
 
 */
74
 
public class FrameBodyEQU2 extends AbstractID3v2FrameBody implements ID3v24FrameBody
75
 
{
76
 
    /**
77
 
     * Creates a new FrameBodyEQU2 datatype.
78
 
     */
79
 
    public FrameBodyEQU2()
80
 
    {
81
 
 
82
 
    }
83
 
 
84
 
    public FrameBodyEQU2(FrameBodyEQU2 body)
85
 
    {
86
 
        super(body);
87
 
    }
88
 
 
89
 
    /**
90
 
     * Creates a new FrameBodyEQU2 datatype.
91
 
     *
92
 
     * @param byteBuffer
93
 
     * @param frameSize
94
 
     * @throws InvalidTagException if unable to create framebody from buffer
95
 
     */
96
 
    public FrameBodyEQU2(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
97
 
    {
98
 
        super(byteBuffer, frameSize);
99
 
    }
100
 
 
101
 
    /**
102
 
     * The ID3v2 frame identifier
103
 
     *
104
 
     * @return the ID3v2 frame identifier  for this frame type
105
 
     */
106
 
    public String getIdentifier()
107
 
    {
108
 
        return ID3v24Frames.FRAME_ID_EQUALISATION2;
109
 
    }
110
 
 
111
 
    /**
112
 
     *
113
 
     */
114
 
    protected void setupObjectList()
115
 
    {
116
 
        objectList.add(new ByteArraySizeTerminated(DataTypes.OBJ_DATA, this));
117
 
    }
118
 
}
 
1
/**
 
2
 *  @author : Paul Taylor
 
3
 *  @author : Eric Farng
 
4
 *
 
5
 *  Version @version:$Id: FrameBodyEQU2.java 832 2009-11-12 13:25:38Z paultaylor $
 
6
 *
 
7
 *  MusicTag Copyright (C)2003,2004
 
8
 *
 
9
 *  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
 
10
 *  General Public  License as published by the Free Software Foundation; either version 2.1 of the License,
 
11
 *  or (at your option) any later version.
 
12
 *
 
13
 *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 
14
 *  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
15
 *  See the GNU Lesser General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU Lesser General Public License along with this library; if not,
 
18
 *  you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
 
19
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
20
 *
 
21
 * Description:
 
22
 *
 
23
 */
 
24
package org.jaudiotagger.tag.id3.framebody;
 
25
 
 
26
import org.jaudiotagger.tag.InvalidTagException;
 
27
import org.jaudiotagger.tag.datatype.ByteArraySizeTerminated;
 
28
import org.jaudiotagger.tag.datatype.DataTypes;
 
29
import org.jaudiotagger.tag.id3.ID3v24Frames;
 
30
 
 
31
import java.nio.ByteBuffer;
 
32
 
 
33
 
 
34
/**
 
35
 * Equalisation (2)
 
36
 * <p/>
 
37
 * This is another subjective, alignment frame. It allows the user to
 
38
 * predefine an equalisation curve within the audio file. There may be
 
39
 * more than one "EQU2" frame in each tag, but only one with the same
 
40
 * identification string.
 
41
 * <p/>
 
42
 * <Header of 'Equalisation (2)', ID: "EQU2">
 
43
 * Interpolation method  $xx
 
44
 * Identification        <text string> $00
 
45
 * <p/>
 
46
 * The 'interpolation method' describes which method is preferred when
 
47
 * an interpolation between the adjustment point that follows. The
 
48
 * following methods are currently defined:
 
49
 * <p/>
 
50
 * $00  Band
 
51
 * No interpolation is made. A jump from one adjustment level to
 
52
 * another occurs in the middle between two adjustment points.
 
53
 * $01  Linear
 
54
 * Interpolation between adjustment points is linear.
 
55
 * <p/>
 
56
 * The 'identification' string is used to identify the situation and/or
 
57
 * device where this adjustment should apply. The following is then
 
58
 * repeated for every adjustment point
 
59
 * <p/>
 
60
 * Frequency          $xx xx
 
61
 * Volume adjustment  $xx xx
 
62
 * <p/>
 
63
 * The frequency is stored in units of 1/2 Hz, giving it a range from 0
 
64
 * to 32767 Hz.
 
65
 * <p/>
 
66
 * The volume adjustment is encoded as a fixed point decibel value, 16
 
67
 * bit signed integer representing (adjustment*512), giving +/- 64 dB
 
68
 * with a precision of 0.001953125 dB. E.g. +2 dB is stored as $04 00
 
69
 * and -2 dB is $FC 00.
 
70
 * <p/>
 
71
 * Adjustment points should be ordered by frequency and one frequency
 
72
 * should only be described once in the frame.
 
73
 */
 
74
public class FrameBodyEQU2 extends AbstractID3v2FrameBody implements ID3v24FrameBody
 
75
{
 
76
    /**
 
77
     * Creates a new FrameBodyEQU2 datatype.
 
78
     */
 
79
    public FrameBodyEQU2()
 
80
    {
 
81
 
 
82
    }
 
83
 
 
84
    public FrameBodyEQU2(FrameBodyEQU2 body)
 
85
    {
 
86
        super(body);
 
87
    }
 
88
 
 
89
    /**
 
90
     * Creates a new FrameBodyEQU2 datatype.
 
91
     *
 
92
     * @param byteBuffer
 
93
     * @param frameSize
 
94
     * @throws InvalidTagException if unable to create framebody from buffer
 
95
     */
 
96
    public FrameBodyEQU2(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
 
97
    {
 
98
        super(byteBuffer, frameSize);
 
99
    }
 
100
 
 
101
    /**
 
102
     * The ID3v2 frame identifier
 
103
     *
 
104
     * @return the ID3v2 frame identifier  for this frame type
 
105
     */
 
106
    public String getIdentifier()
 
107
    {
 
108
        return ID3v24Frames.FRAME_ID_EQUALISATION2;
 
109
    }
 
110
 
 
111
    /**
 
112
     *
 
113
     */
 
114
    protected void setupObjectList()
 
115
    {
 
116
        objectList.add(new ByteArraySizeTerminated(DataTypes.OBJ_DATA, this));
 
117
    }
 
118
}