org.jaudiotagger.audio.asf.data
Class StreamBitratePropertiesChunk

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
      extended by org.jaudiotagger.audio.asf.data.StreamBitratePropertiesChunk

public class StreamBitratePropertiesChunk
extends Chunk

This class represents the "Stream Bitrate Properties" chunk of an ASF media file.
It is optional, but contains useful information about the streams bitrate.

Author:
Christian Laireiter

Field Summary
private  java.util.List<java.lang.Long> bitRates
          For each call of addBitrateRecord(int,long) an Long object is appended, which represents the average bitrate.
private  java.util.List<java.lang.Integer> streamNumbers
          For each call of addBitrateRecord(int,long) an Integer object is appended, which represents the stream-number.
 
Fields inherited from class org.jaudiotagger.audio.asf.data.Chunk
chunkLength, guid, position
 
Constructor Summary
StreamBitratePropertiesChunk(java.math.BigInteger chunkLen)
          Creates an instance.
 
Method Summary
 void addBitrateRecord(int streamNum, long averageBitrate)
          Adds the public values of a stream-record.
 long getAvgBitrate(int streamNumber)
          Returns the average bitrate of the given stream.
 java.lang.String prettyPrint(java.lang.String prefix)
          (overridden)
 
Methods inherited from class org.jaudiotagger.audio.asf.data.Chunk
getChunckEnd, getChunkEnd, getChunkLength, getGuid, getPosition, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bitRates

private final java.util.List<java.lang.Long> bitRates
For each call of addBitrateRecord(int,long) an Long object is appended, which represents the average bitrate.


streamNumbers

private final java.util.List<java.lang.Integer> streamNumbers
For each call of addBitrateRecord(int,long) an Integer object is appended, which represents the stream-number.

Constructor Detail

StreamBitratePropertiesChunk

public StreamBitratePropertiesChunk(java.math.BigInteger chunkLen)
Creates an instance.

Parameters:
chunkLen - Length of current chunk.
Method Detail

addBitrateRecord

public void addBitrateRecord(int streamNum,
                             long averageBitrate)
Adds the public values of a stream-record.

Parameters:
streamNum - The number of the referred stream.
averageBitrate - Its average bitrate.

getAvgBitrate

public long getAvgBitrate(int streamNumber)
Returns the average bitrate of the given stream.

Parameters:
streamNumber - Number of the stream whose bitrate to determine.
Returns:
The average bitrate of the numbered stream. -1 if no information was given.

prettyPrint

public java.lang.String prettyPrint(java.lang.String prefix)
(overridden)

Overrides:
prettyPrint in class Chunk
Parameters:
prefix - each line gets this string prepended.
Returns:
Information of current Chunk Object.
See Also:
Chunk.prettyPrint(String)