|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelliker.id3.XingVBRHeader
Field Summary | |
private int |
avgBitrate
|
private boolean |
exists
|
private int |
FLAGS_SIZE
|
private int |
HEAD_SIZE
|
private java.lang.String |
HEAD_START
|
private int |
length
|
private int |
numBytes
|
private int |
numFrames
|
private int |
playingTime
|
private double[] |
TIMEPERFRAME_TABLE
|
private byte[] |
toc
|
private int |
TOC_SIZE
|
private int |
vbrScale
|
Constructor Summary | |
XingVBRHeader(java.io.RandomAccessFile raf,
long offset,
int layer,
int mpegVersion,
int sampleRate,
int channelMode)
Looks for a Xing VBR header in the file. |
Method Summary | |
private void |
calcValues(int layer,
int mpegVersion,
int sampleRate)
Calculates the playing time and the average bitrate. |
private boolean |
checkHeader(java.io.RandomAccessFile raf,
long offset,
int channelMode,
int mpegVersion)
Checks to see if a xing header is in this file |
int |
getAvgBitrate()
Returns the average bit rate of the mpeg file if a Xing header exists and -1 otherwise. |
int |
getLength()
Returns the length (in bytes) of this Xing VBR header. |
int |
getNumBytes()
Returns the number of data bytes in the mpeg frames. |
int |
getNumFrames()
Returns the number of MPEG frames in the file passed to the constructor. |
int |
getPlayingTime()
Returns the calculated playing time of the mpeg file if a Xing header exists and -1 otherwise. |
byte[] |
getTOC()
Returns the toc used to seek to an area of this VBR file. |
int |
getVBRScale()
Returns the VBR scale used to generate this VBR file. |
boolean |
headerExists()
Returns true if a Xing VBR header was found in the file passed to the constructor. |
private void |
readHeader(java.io.RandomAccessFile raf)
Parses the header data. |
java.lang.String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private final java.lang.String HEAD_START
private final int HEAD_SIZE
private final int FLAGS_SIZE
private final int TOC_SIZE
private final double[] TIMEPERFRAME_TABLE
private int numFrames
private int numBytes
private int vbrScale
private byte[] toc
private int avgBitrate
private int playingTime
private int length
private boolean exists
Constructor Detail |
public XingVBRHeader(java.io.RandomAccessFile raf, long offset, int layer, int mpegVersion, int sampleRate, int channelMode) throws java.io.IOException, CorruptHeaderException
raf
- the file to read fromoffset
- the location of the first mpeg framelayer
- the layer value read by the MPEGAudioFrameHeadermpegVersion
- the version value read by the MPEGAudioFrameHeadersampleRate
- the sample rate read by the MPEGAudioFrameHeaderchannelMode
- the channel mode read by the MPEGAudioFrameHeader
java.io.IOException
- if an error occurs
CorruptHeaderException
- if an error occursMethod Detail |
private boolean checkHeader(java.io.RandomAccessFile raf, long offset, int channelMode, int mpegVersion) throws java.io.IOException
raf
- the file to read fromoffset
- the location of the first mpeg framempegVersion
- the version value read by the MPEGAudioFrameHeaderchannelMode
- the channel mode read by the MPEGAudioFrameHeader
java.io.IOException
- if an error occursprivate void readHeader(java.io.RandomAccessFile raf) throws java.io.IOException, CorruptHeaderException
raf
- the file to read from (pointing after the "Xing")
java.io.IOException
- if an error occurs
CorruptHeaderException
- if an error occursprivate void calcValues(int layer, int mpegVersion, int sampleRate)
layer
- the layer value read by the MPEGAudioFrameHeadermpegVersion
- the version value read by the MPEGAudioFrameHeadersampleRate
- the sample rate read by the MPEGAudioFrameHeaderpublic boolean headerExists()
public int getNumFrames()
public int getNumBytes()
public int getVBRScale()
public byte[] getTOC()
public int getAvgBitrate()
public int getPlayingTime()
public java.lang.String toString()
public int getLength()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |