"L. Spiro Engine"
|
#include <LSSWaveLoader.h>
Classes | |
struct | LSE_WAVE_FILE_CHUNK_HEADER |
struct | LSE_WAVE_FILE_FMT_DATA |
struct | LSE_WAVE_FILE_HEADER |
struct | LSE_WAVE_FILE_INFO |
Public Types | |
enum | LSE_WAVE_EXTENSIBLE { LSE_WE_PCM = 1, LSE_WE_EXTENSIBLE = 0xFFFE, LSE_WE_EXTPERIMENTAL = 0xFFFF } |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_INFO * | LPLSE_WAVE_FILE_INFO |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_INFO | LPCLSE_WAVE_FILE_INFO |
Static Public Member Functions | |
static LSBOOL LSE_CALL | GetWaveInfo (const LSUINT8 *_pui8File, LSUINT32 _ui32FileLen, LSE_WAVE_FILE_INFO &_wfiInfo) |
static LSBOOL LSE_CALL | GetWaveInfo (const CFileMap &_fmMap, LSE_WAVE_FILE_INFO &_wfiInfo) |
static LSBOOL LSE_CALL | LoadWavFile (const LSCHAR *_pcFile, LSUINT8 *&_pui8Data, LSUINT32 &_ui32Length, LSUINT32 &_ui32Freq, LSUINT32 &_ui32Bits, LSUINT32 &_ui32Channels, CAllocator *_paAllocator) |
static LSBOOL LSE_CALL | LoadWavFile (const LSUINT8 *_pui8File, LSUINT32 _ui32FileLen, LSUINT8 *&_pui8Data, LSUINT32 &_ui32Length, LSUINT32 &_ui32Freq, LSUINT32 &_ui32Bits, LSUINT32 &_ui32Channels, CAllocator *_paAllocator) |
Protected Types | |
enum | LSS_WAVE_SPEAKERS { LSS_SPEAKER_FRONT_LEFT = (1 << 0), LSS_SPEAKER_FRONT_RIGHT = (1 << 1), LSS_SPEAKER_FRONT_CENTER = (1 << 2), LSS_SPEAKER_LOW_FREQUENCY = (1 << 3), LSS_SPEAKER_BACK_LEFT = (1 << 4), LSS_SPEAKER_BACK_RIGHT = (1 << 5), LSS_SPEAKER_FRONT_LEFT_OF_CENTER = (1 << 6), LSS_SPEAKER_FRONT_RIGHT_OF_CENTER = (1 << 7), LSS_SPEAKER_BACK_CENTER = (1 << 8), LSS_SPEAKER_SIDE_LEFT = (1 << 9), LSS_SPEAKER_SIDE_RIGHT = (1 << 10), LSS_SPEAKER_TOP_CENTER = (1 << 11), LSS_SPEAKER_TOP_FRONT_LEFT = (1 << 12), LSS_SPEAKER_TOP_FRONT_CENTER = (1 << 13), LSS_SPEAKER_TOP_FRONT_RIGHT = (1 << 14), LSS_SPEAKER_TOP_BACK_LEFT = (1 << 15), LSS_SPEAKER_TOP_BACK_CENTER = (1 << 16), LSS_SPEAKER_TOP_BACK_RIGHT = (1 << 17), LSS_SPEAKER_ANY = 0x80000000 } |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_HEADER * | LPLSE_WAVE_FILE_HEADER |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_HEADER | LPCLSE_WAVE_FILE_HEADER |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_CHUNK_HEADER * | LPLSE_WAVE_FILE_CHUNK_HEADER |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_CHUNK_HEADER | LPCLSE_WAVE_FILE_CHUNK_HEADER |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_FMT_DATA * | LPLSE_WAVE_FILE_FMT_DATA |
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_FMT_DATA | LPCLSE_WAVE_FILE_FMT_DATA |
Static Protected Member Functions | |
static const LPLSE_WAVE_FILE_CHUNK_HEADER LSE_CALL | FindChunk (const LSCHAR *_pcName, const LSUINT8 *_pui8Data, LSUINT32 _ui32Len) |
static const LSUINT64 LSE_CALL | FindChunk (const LSCHAR *_pcName, const CFileMap &_fmMap) |
static CSoundLib::LSS_CHANNELS LSE_CALL | FindSoundLibraryFormat (LSUINT32 _ui32Channels, LSUINT32 _ui32Bits) |
static LSBOOL LSE_CALL | GetWaveInfo (const LSE_WAVE_FILE_HEADER &_wfhHeader, const LSE_WAVE_FILE_FMT_DATA &_wffdFmt, const LSE_WAVE_FILE_CHUNK_HEADER &_wfchData, LSUINT64 _ui64FileLen, LSE_WAVE_FILE_INFO &_wfiInfo) |
Class CWaveLoader
Description: Loads a wave file to RAM using the given allocator.
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_CHUNK_HEADER * lss::CWaveLoader::LPLSE_WAVE_FILE_CHUNK_HEADER [protected] |
A chunk header.
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_FMT_DATA * lss::CWaveLoader::LPLSE_WAVE_FILE_FMT_DATA [protected] |
The "fmt " data part.
typedef struct lss::CWaveLoader::LSE_WAVE_FILE_HEADER * lss::CWaveLoader::LPLSE_WAVE_FILE_HEADER [protected] |
The wave-file header.
Stores information about a wave file.
The compression values.
enum lss::CWaveLoader::LSS_WAVE_SPEAKERS [protected] |
The speaker arrangements found in wave files. These can be found in the non-portable ksmedia.h.
static const LPLSE_WAVE_FILE_CHUNK_HEADER LSE_CALL lss::CWaveLoader::FindChunk | ( | const LSCHAR * | _pcName, |
const LSUINT8 * | _pui8Data, | ||
LSUINT32 | _ui32Len | ||
) | [static, protected] |
Find a chunk header in a valid WAVE file.
_pcName | Name of the chunk to find. |
_pui8Data | Buffered file data. |
_ui32Len | Size of the buffered file data. |
static const LSUINT64 LSE_CALL lss::CWaveLoader::FindChunk | ( | const LSCHAR * | _pcName, |
const CFileMap & | _fmMap | ||
) | [static, protected] |
Find a chunk header in a valid WAVE file.
_pcName | Name of the chunk to find. |
_fmMap | Buffered file data. |
static CSoundLib::LSS_CHANNELS LSE_CALL lss::CWaveLoader::FindSoundLibraryFormat | ( | LSUINT32 | _ui32Channels, |
LSUINT32 | _ui32Bits | ||
) | [static, protected] |
Does the format of the WAVE have an exact (and supported) sound-library format? Returns CSoundLib::LSS_C_TOTAL if not.
_ui32Channels | Number of channels. |
_ui32Bits | Number of bits. |
static LSBOOL LSE_CALL lss::CWaveLoader::GetWaveInfo | ( | const LSUINT8 * | _pui8File, |
LSUINT32 | _ui32FileLen, | ||
LSE_WAVE_FILE_INFO & | _wfiInfo | ||
) | [static] |
Get information about a wave file from a loaded file.
_pui8File | Loaded file buffer. The entire file should be loaded for this to succeed. |
_ui32DataLen | Length of the loaded buffer. |
_wfiInfo | Reference to a LSE_WAVE_FILE_INFO structure containing the returned data. |
static LSBOOL LSE_CALL lss::CWaveLoader::GetWaveInfo | ( | const CFileMap & | _fmMap, |
LSE_WAVE_FILE_INFO & | _wfiInfo | ||
) | [static] |
Get information about a wave file from a mapped file.
_fmMap | The mapped file. |
_wfiInfo | Reference to a LSE_WAVE_FILE_INFO structure containing the returned data. |
static LSBOOL LSE_CALL lss::CWaveLoader::GetWaveInfo | ( | const LSE_WAVE_FILE_HEADER & | _wfhHeader, |
const LSE_WAVE_FILE_FMT_DATA & | _wffdFmt, | ||
const LSE_WAVE_FILE_CHUNK_HEADER & | _wfchData, | ||
LSUINT64 | _ui64FileLen, | ||
LSE_WAVE_FILE_INFO & | _wfiInfo | ||
) | [static, protected] |
Get information about a wave file from key parts of the file header.
_wfhHeader | Structure containing the data in the header of the wave file. |
_wffdFmt | The format data of the format chunk. |
_wfchData | The data chunk of the file data. |
_ui64FileLen | The length of the file. |
_wfiInfo | Reference to a LSE_WAVE_FILE_INFO structure containing the returned data. |
static LSBOOL LSE_CALL lss::CWaveLoader::LoadWavFile | ( | const LSUINT8 * | _pui8File, |
LSUINT32 | _ui32FileLen, | ||
LSUINT8 *& | _pui8Data, | ||
LSUINT32 & | _ui32Length, | ||
LSUINT32 & | _ui32Freq, | ||
LSUINT32 & | _ui32Bits, | ||
LSUINT32 & | _ui32Channels, | ||
CAllocator * | _paAllocator | ||
) | [static] |
Load a WAVE file that has already been loaded to RAM.
_pui8File | The file data. |
_ui32FileLen | Length of the file data. |
_pui8Data | Pointer filled with the file data allocated with _paAllocator. |
_ui32Length | Length of the wave data in bytes. |
_ui32Freq | Frequency of the wave data. |
_ui32Bits | Bits per sample of the wave data. |
_ui32Channels | Channels in the wave data. |
_paAllocator | Allocator used to allocate _pui8Data, or NULL to use LSENEW. |
static LSBOOL LSE_CALL lss::CWaveLoader::LoadWavFile | ( | const LSCHAR * | _pcFile, |
LSUINT8 *& | _pui8Data, | ||
LSUINT32 & | _ui32Length, | ||
LSUINT32 & | _ui32Freq, | ||
LSUINT32 & | _ui32Bits, | ||
LSUINT32 & | _ui32Channels, | ||
CAllocator * | _paAllocator | ||
) | [static] |
Load a WAVE file. Returns the PCM sound data, data length, frequency, bit depth, and channels. PCM data is allocated via the given allocator.
_pcFile | The file to load. |
_pui8Data | Pointer filled with the file data allocated with _paAllocator. |
_ui32Length | Length of the wave data in bytes. |
_ui32Freq | Frequency of the wave data. |
_ui32Bits | Bits per sample of the wave data. |
_ui32Channels | Channels in the wave data. |
_paAllocator | Allocator used to allocate _pui8Data, or NULL to use LSENEW. |