SFXFileStream

Engine/source/sfx/sfxFileStream.h

An SFXStream that streams from a file.

More...

Protected Types

CreateFnsVector 
ExtensionsVector 

Protected Attributes

The format of the data in the stream.

bool

If true then we're responsible for closing the stream.

The number of samples in the data stream.

The file stream we're reading from.

Protected Functions

Constructs the stream in an uninitilized state.

Overloaded for cleanup of file format specific structures.

bool

Overloaded in the derived classes to read the file header.

Public Static Functions

create(String filename)

This is a helper function used to create an appropriate SFXStream for the requested sound file.

bool
exists(String filename)

Public Functions

Destructor.

Closes the stream.

The data size in bytes of the decompressed PCM data.

The length of the sound in milliseconds.

The format of the data in the stream.

The number of samples in the data stream.

bool

Returns true if we've reached the end of the stream.

bool
open(Stream * stream, bool ownStream)

Opens and optionally takes ownership of the stream.

Detailed Description

An SFXStream that streams from a file.

Protected Types

typedef Vector< SFXFILESTREAM_CREATE_FN > CreateFnsVector 
typedef Vector< String > ExtensionsVector 

Protected Static Attributes

CreateFnsVector smCreateFns 
ExtensionsVector smExtensions 

Protected Attributes

SFXFormat mFormat 

The format of the data in the stream.

bool mOwnStream 

If true then we're responsible for closing the stream.

U32 mSamples 

The number of samples in the data stream.

Stream * mStream 

The file stream we're reading from.

Protected Functions

SFXFileStream()

Constructs the stream in an uninitilized state.

SFXFileStream(const SFXFileStream & cloneFrom)

_close()

Overloaded for cleanup of file format specific structures.

Reimplemented by: SFXWavStream

_readHeader()

Overloaded in the derived classes to read the file header.

It should initialize mFormat and mSamples.

Reimplemented by: SFXWavStream

Public Static Functions

create(String filename)

This is a helper function used to create an appropriate SFXStream for the requested sound file.

Parameters:

filename

The sound file path with or without extension.

exists(String filename)

registerExtension(String ext, SFXFILESTREAM_CREATE_FN create_fn)

unregisterExtension(String ext)

Public Functions

~SFXFileStream()

Destructor.

close()

Closes the stream.

getDataLength()

Reimplemented from: SFXStream

getDuration()

Reimplemented from: SFXStream

getFormat()

Reimplemented from: SFXStream

getSampleCount()

Reimplemented from: SFXStream

isEOS()

Reimplemented from: SFXStream

open(Stream * stream, bool ownStream)

Opens and optionally takes ownership of the stream.