2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef ENGINE_CLIENT_SOUND_H
|
|
|
|
#define ENGINE_CLIENT_SOUND_H
|
|
|
|
|
|
|
|
#include <engine/sound.h>
|
|
|
|
|
|
|
|
class CSound : public IEngineSound
|
|
|
|
{
|
2011-06-27 20:57:06 +00:00
|
|
|
int m_SoundEnabled;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
|
|
|
IEngineGraphics *m_pGraphics;
|
|
|
|
IStorage *m_pStorage;
|
|
|
|
|
|
|
|
virtual int Init();
|
|
|
|
|
|
|
|
int Update();
|
|
|
|
int Shutdown();
|
2011-02-12 10:40:36 +00:00
|
|
|
int AllocID();
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
static void RateConvert(int SampleID);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// TODO: Refactor: clean this mess up
|
|
|
|
static IOHANDLE ms_File;
|
|
|
|
static int ReadData(void *pBuffer, int Size);
|
|
|
|
|
2011-06-27 20:57:06 +00:00
|
|
|
virtual bool IsSoundEnabled() { return m_SoundEnabled != 0; }
|
|
|
|
|
2012-08-12 11:56:35 +00:00
|
|
|
virtual CSampleHandle LoadWV(const char *pFilename);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
virtual void SetListenerPos(float x, float y);
|
2014-07-30 15:50:39 +00:00
|
|
|
virtual void SetChannelVolume(int ChannelID, float Vol);
|
|
|
|
virtual void SetMaxDistance(float Distance);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2012-08-12 11:56:35 +00:00
|
|
|
int Play(int ChannelID, CSampleHandle SampleID, int Flags, float x, float y);
|
|
|
|
virtual int PlayAt(int ChannelID, CSampleHandle SampleID, int Flags, float x, float y);
|
|
|
|
virtual int Play(int ChannelID, CSampleHandle SampleID, int Flags);
|
|
|
|
virtual void Stop(CSampleHandle SampleID);
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void StopAll();
|
2013-09-14 09:49:55 +00:00
|
|
|
virtual bool IsPlaying(CSampleHandle SampleID);
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|