openclonk/src/platform/C4SoundSystem.h

67 lines
2.2 KiB
C
Raw Normal View History

2009-05-08 13:28:41 +00:00
/*
* OpenClonk, http://www.openclonk.org
*
* Copyright (c) 1998-2000, Matthes Bender
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
* Copyright (c) 2009-2013, The OpenClonk Team and contributors
2009-05-08 13:28:41 +00:00
*
* Distributed under the terms of the ISC license; see accompanying file
* "COPYING" for details.
2009-05-08 13:28:41 +00:00
*
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
* See accompanying file "TRADEMARK" for details.
2009-05-08 13:28:41 +00:00
*
* To redistribute this file separately, substitute the full license texts
* for the above references.
2009-05-08 13:28:41 +00:00
*/
/* Handles the sound bank and plays effects using FMOD */
#ifndef INC_C4SoundSystem
#define INC_C4SoundSystem
#include <C4Group.h>
const int32_t
C4MaxSoundName=100,
C4MaxSoundInstances=20,
C4NearSoundRadius=50,
C4AudibilityRadius=700;
2009-05-08 13:28:41 +00:00
const int32_t SoundUnloadTime=60, SoundMaxUnloadSize=100000;
class C4SoundInstance;
class C4SoundEffect;
2009-05-08 13:28:41 +00:00
class C4SoundSystem
{
public:
C4SoundSystem();
~C4SoundSystem();
void Clear();
void Execute();
int32_t LoadEffects(C4Group &hGroup);
C4SoundInstance *NewEffect(const char *szSound, bool fLoop = false, int32_t iVolume = 100, C4Object *pObj = NULL, int32_t iCustomFalloffDistance = 0, int32_t iPitch = 0);
C4SoundInstance *FindInstance(const char *szSound, C4Object *pObj);
bool Init();
void ClearPointers(C4Object *pObj);
protected:
C4Group SoundFile;
C4SoundEffect *FirstSound;
void ClearEffects();
C4SoundEffect* GetEffect(const char *szSound);
int32_t RemoveEffect(const char *szFilename);
};
2009-05-08 13:28:41 +00:00
C4SoundInstance *StartSoundEffect(const char *szSndName, bool fLoop = false, int32_t iVolume = 100, C4Object *pObj = NULL, int32_t iCustomFalloffDistance = 0, int32_t iPitch = 0);
C4SoundInstance *StartSoundEffectAt(const char *szSndName, int32_t iX, int32_t iY, int32_t iVolume = 100, int32_t iCustomFallofDistance = 0, int32_t iPitch = 0);
C4SoundInstance *GetSoundInstance(const char *szSndName, C4Object *pObj);
void StopSoundEffect(const char *szSndName, C4Object *pObj);
void SoundLevel(const char *szSndName, C4Object *pObj, int32_t iLevel);
void SoundPan(const char *szSndName, C4Object *pObj, int32_t iPan);
void SoundPitch(const char *szSndName, C4Object *pObj, int32_t iPitch);
void SoundUpdate(C4SoundInstance *inst, int32_t iLevel, int32_t iPitch);
2009-05-08 13:28:41 +00:00
#endif