C# Class Translate.Services.Audio.RiffParser

Riff Parser. Parses a Riff style file.
Inheritance: IDisposable
Mostra file Open project: nikhilk/silverlightfx

Private Properties

Property Type Description
ReadChunkHeader void
ReadRiffHeader void

Public Methods

Method Description
Dispose ( ) : void

Implement the Dispose method to release the resources

EnumerateChunksInList ( ) : RiffParser

Return a parser for a LIST

FormatFourCC ( FourCC fcc ) : string

Format a FourCC code

IsAligned ( int startIndex, int align ) : bool

Is the start index aligned

IsAligned ( long startIndex, int align ) : bool

Is the start index aligned

MoveToChunkOffset ( uint offset ) : void

Move the file pointer to a byte offset from the start of the current chunk.

MoveToNextChunk ( ) : void

Advance to the start of the next chunk and read the chunk header

MoveToStartOfChunk ( ) : void

Move the file pointer to the start of the current chunk

PrintChunkInformation ( int indent ) : void

Print the chunk information of the current chunk and descendants

ProcessDataFromChunk ( uint count ) : uint

Process data from a chunk (just like reading without actually getting the data)

ReadDataFromChunk ( uint count ) : byte[]

Read data from the current chunk. (Starts at the current file ptr.)

RiffParser ( Stream stream, FourCC id, long startOfContainer ) : System

Initializes a new instance of the RiffParser class.

RiffRound ( int count ) : int

Round a count for Riff chunks

RiffRound ( long count ) : long

Round a count for Riff chunks

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Implementation of the IDisposable pattern

Private Methods

Method Description
ReadChunkHeader ( ) : void
ReadRiffHeader ( ) : void

Read the container header section. (The 'RIFF' or 'LIST' header.) This method verifies the header is well-formed and caches the container'stream FOURCC type.

Method Details

Dispose() public method

Implement the Dispose method to release the resources
public Dispose ( ) : void
return void

Dispose() protected method

Implementation of the IDisposable pattern
protected Dispose ( bool disposing ) : void
disposing bool Are we being destroyed
return void

EnumerateChunksInList() public method

Return a parser for a LIST
public EnumerateChunksInList ( ) : RiffParser
return RiffParser

FormatFourCC() public static method

Format a FourCC code
public static FormatFourCC ( FourCC fcc ) : string
fcc FourCC The FourCC code
return string

IsAligned() public static method

Is the start index aligned
public static IsAligned ( int startIndex, int align ) : bool
startIndex int the start index
align int The alignment value
return bool

IsAligned() public static method

Is the start index aligned
public static IsAligned ( long startIndex, int align ) : bool
startIndex long the start index
align int The alignment value
return bool

MoveToChunkOffset() public method

Move the file pointer to a byte offset from the start of the current chunk.
public MoveToChunkOffset ( uint offset ) : void
offset uint The offset we want to move to
return void

MoveToNextChunk() public method

Advance to the start of the next chunk and read the chunk header
public MoveToNextChunk ( ) : void
return void

MoveToStartOfChunk() public method

Move the file pointer to the start of the current chunk
public MoveToStartOfChunk ( ) : void
return void

PrintChunkInformation() public method

Print the chunk information of the current chunk and descendants
public PrintChunkInformation ( int indent ) : void
indent int The indent level for this chunk
return void

ProcessDataFromChunk() public method

Process data from a chunk (just like reading without actually getting the data)
public ProcessDataFromChunk ( uint count ) : uint
count uint The number of bytes we want to skip
return uint

ReadDataFromChunk() public method

Read data from the current chunk. (Starts at the current file ptr.)
public ReadDataFromChunk ( uint count ) : byte[]
count uint The number of bytes we want to read
return byte[]

RiffParser() public method

Initializes a new instance of the RiffParser class.
public RiffParser ( Stream stream, FourCC id, long startOfContainer ) : System
stream Stream The stream that we will parse
id FourCC The primary Riff ID that we need
startOfContainer long The start offset of the container in the stream
return System

RiffRound() public static method

Round a count for Riff chunks
public static RiffRound ( int count ) : int
count int The count value that we want to round
return int

RiffRound() public static method

Round a count for Riff chunks
public static RiffRound ( long count ) : long
count long The count value that we want to round
return long