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_SOUND_H
|
|
|
|
#define ENGINE_SOUND_H
|
|
|
|
|
|
|
|
#include "kernel.h"
|
|
|
|
|
|
|
|
class ISound : public IInterface
|
|
|
|
{
|
|
|
|
MACRO_INTERFACE("sound", 0)
|
|
|
|
public:
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
FLAG_LOOP=1,
|
|
|
|
FLAG_POS=2,
|
|
|
|
FLAG_ALL=3
|
|
|
|
};
|
|
|
|
|
2011-06-27 20:57:06 +00:00
|
|
|
virtual bool IsSoundEnabled() = 0;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual int LoadWV(const char *pFilename) = 0;
|
2014-10-11 11:38:08 +00:00
|
|
|
virtual void UnloadSample(int SampleID) = 0;
|
2011-08-11 08:59:14 +00:00
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
virtual void SetChannel(int ChannelID, float Volume, float Panning) = 0;
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void SetListenerPos(float x, float y) = 0;
|
2011-08-11 08:59:14 +00:00
|
|
|
|
2011-04-13 18:00:54 +00:00
|
|
|
virtual int PlayAt(int ChannelID, int SampleID, int Flags, float x, float y) = 0;
|
|
|
|
virtual int Play(int ChannelID, int SampleID, int Flags) = 0;
|
|
|
|
virtual void Stop(int SampleID) = 0;
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void StopAll() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class IEngineSound : public ISound
|
|
|
|
{
|
|
|
|
MACRO_INTERFACE("enginesound", 0)
|
|
|
|
public:
|
|
|
|
virtual int Init() = 0;
|
|
|
|
virtual int Update() = 0;
|
|
|
|
virtual int Shutdown() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern IEngineSound *CreateEngineSound();
|
|
|
|
|
|
|
|
#endif
|