2011-11-22 21:28:15 +00:00
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __EFXLIBH
|
|
|
|
#define __EFXLIBH
|
|
|
|
|
2011-12-11 14:33:44 +00:00
|
|
|
#if ID_OPENAL_EAX
|
2011-12-11 15:13:49 +00:00
|
|
|
#include <eax4.h>
|
2011-12-11 14:33:44 +00:00
|
|
|
#endif
|
2011-11-22 21:28:15 +00:00
|
|
|
|
2011-12-16 22:28:29 +00:00
|
|
|
#include "idlib/containers/List.h"
|
|
|
|
#include "idlib/Str.h"
|
|
|
|
#include "idlib/Lexer.h"
|
|
|
|
#include "idlib/Heap.h"
|
|
|
|
#include "sound/sound.h"
|
2011-11-22 21:28:15 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// Class definitions.
|
|
|
|
class idSoundEffect
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
idSoundEffect() {
|
|
|
|
};
|
2011-12-11 15:02:05 +00:00
|
|
|
~idSoundEffect() {
|
2011-11-22 21:28:15 +00:00
|
|
|
if ( data && datasize ) {
|
|
|
|
Mem_Free( data );
|
|
|
|
data = NULL;
|
|
|
|
}
|
|
|
|
}
|
2011-12-11 15:02:05 +00:00
|
|
|
|
2011-11-22 21:28:15 +00:00
|
|
|
idStr name;
|
|
|
|
int datasize;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
class idEFXFile
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Protected data members.
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Public data members.
|
|
|
|
|
|
|
|
private:
|
2011-12-11 15:02:05 +00:00
|
|
|
|
2011-11-22 21:28:15 +00:00
|
|
|
public:
|
|
|
|
idEFXFile();
|
|
|
|
~idEFXFile();
|
|
|
|
|
|
|
|
bool FindEffect( idStr &name, idSoundEffect **effect, int *index );
|
|
|
|
bool ReadEffect( idLexer &lexer, idSoundEffect *effect );
|
|
|
|
bool LoadFile( const char *filename, bool OSPath = false );
|
|
|
|
void UnloadFile( void );
|
|
|
|
void Clear( void );
|
|
|
|
|
|
|
|
idList<idSoundEffect *>effects;
|
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __EFXLIBH
|