entagged.audioformats.asf.data
Class AsfHeader

java.lang.Object
  extended by entagged.audioformats.asf.data.Chunk
      extended by entagged.audioformats.asf.data.AsfHeader

public class AsfHeader
extends Chunk

Each asf file starts with a so called header.
This header contains other chunks. Each chunk starts with a 16 byte GUID followed by the length (in bytes) of the chunk (including GUID). The length number takes 8 bytes and is unsigned. Finally the chunk's data appears.

Author:
Christian Laireiter

Field Summary
 
Fields inherited from class entagged.audioformats.asf.data.Chunk
chunkLength, guid, position
 
Constructor Summary
AsfHeader(long pos, BigInteger chunkLen, long chunkCnt)
          Creates an instance.
 
Method Summary
 void addStreamChunk(StreamChunk toAdd)
          This method appends a StreamChunk to the header.
 void addUnspecifiedChunk(Chunk toAppend)
          This method appends the given chunk to the unspecifiedlist.
 AudioStreamChunk getAudioStreamChunk()
          This method returns the first audio stream chunk found in the asf file or stream.
 long getChunkCount()
           
 ContentDescription getContentDescription()
           
 EncodingChunk getEncodingChunk()
           
 ExtendedContentDescription getExtendedContentDescription()
           
 FileHeader getFileHeader()
           
 StreamBitratePropertiesChunk getStreamBitratePropertiesChunk()
           
 StreamChunk getStreamChunk(int index)
          This method returns the StreamChunk at given index.
 int getStreamChunkCount()
          This method returns the amount of StreamChunks in this header.
 Chunk getUnspecifiedChunk(int index)
          This method returns the unspecified chunk at given position.
 int getUnspecifiedChunkCount()
          This method returns the number of Chunkobjects which where inserted using addUnspecifiedChunk(Chunk).
 String prettyPrint()
          (overridden)
 void setContentDescription(ContentDescription contentDesc)
           
 void setEncodingChunk(EncodingChunk encChunk)
           
 void setExtendedContentDescription(ExtendedContentDescription th)
           
 void setFileHeader(FileHeader fh)
           
 void setStreamBitratePropertiesChunk(StreamBitratePropertiesChunk streamBitratePropertiesChunk1)
           
 
Methods inherited from class entagged.audioformats.asf.data.Chunk
getChunckEnd, getChunkLength, getGuid, getPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AsfHeader

public AsfHeader(long pos,
                 BigInteger chunkLen,
                 long chunkCnt)
Creates an instance.

Parameters:
pos - see Chunk.position
chunkLen - see Chunk.chunkLength
chunkCnt -
Method Detail

addStreamChunk

public void addStreamChunk(StreamChunk toAdd)
This method appends a StreamChunk to the header.

Parameters:
toAdd - Chunk to add.

addUnspecifiedChunk

public void addUnspecifiedChunk(Chunk toAppend)
This method appends the given chunk to the unspecifiedlist.

Parameters:
toAppend - The chunk whose use is unknown or of no interest.

getAudioStreamChunk

public AudioStreamChunk getAudioStreamChunk()
This method returns the first audio stream chunk found in the asf file or stream.

Returns:
Returns the audioStreamChunk.

getChunkCount

public long getChunkCount()
Returns:
Returns the chunkCount.

getContentDescription

public ContentDescription getContentDescription()
Returns:
Returns the contentDescription.

getEncodingChunk

public EncodingChunk getEncodingChunk()
Returns:
Returns the encodingChunk.

getExtendedContentDescription

public ExtendedContentDescription getExtendedContentDescription()
Returns:
Returns the tagHeader.

getFileHeader

public FileHeader getFileHeader()
Returns:
Returns the fileHeader.

getStreamBitratePropertiesChunk

public StreamBitratePropertiesChunk getStreamBitratePropertiesChunk()
Returns:
Returns the streamBitratePropertiesChunk.

getStreamChunk

public StreamChunk getStreamChunk(int index)
This method returns the StreamChunk at given index.

Parameters:
index - index of the wanted chunk
Returns:
StreamChunk at given index.

getStreamChunkCount

public int getStreamChunkCount()
This method returns the amount of StreamChunks in this header.

Returns:
Number of inserted StreamChunks.

getUnspecifiedChunk

public Chunk getUnspecifiedChunk(int index)
This method returns the unspecified chunk at given position.

Parameters:
index - Index of the wanted chunk
Returns:
The chunk at given index.

getUnspecifiedChunkCount

public int getUnspecifiedChunkCount()
This method returns the number of Chunkobjects which where inserted using addUnspecifiedChunk(Chunk).

Returns:
Number of unspecified chunks.

prettyPrint

public String prettyPrint()
(overridden)

Overrides:
prettyPrint in class Chunk
Returns:
Information of current Chunk Object.
See Also:
Chunk.prettyPrint()

setContentDescription

public void setContentDescription(ContentDescription contentDesc)
Parameters:
contentDesc - sets the contentDescription. null deletes the chunk.

setEncodingChunk

public void setEncodingChunk(EncodingChunk encChunk)
Parameters:
encChunk - The encodingChunk to set.

setExtendedContentDescription

public void setExtendedContentDescription(ExtendedContentDescription th)
Parameters:
th - sets the extendedContentDescription. null delete the chunk.

setFileHeader

public void setFileHeader(FileHeader fh)
Parameters:
fh -

setStreamBitratePropertiesChunk

public void setStreamBitratePropertiesChunk(StreamBitratePropertiesChunk streamBitratePropertiesChunk1)
Parameters:
streamBitratePropertiesChunk - The streamBitratePropertiesChunk to set.


Copyright © 2007-2008. All Rights Reserved.