lugre_sound.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LUGRE_SOUND_H
00025 #define LUGRE_SOUND_H
00026
00027 #include "lugre_smartptr.h"
00028
00029 class lua_State;
00030
00031 namespace Lugre {
00032
00034 class cSoundSource : public cSmartPointable {
00035 protected:
00036 cSoundSource(){};
00037 public:
00038 virtual ~cSoundSource(){};
00039
00041 virtual const bool Play() = 0;
00043 virtual const bool IsPlaying() = 0;
00045 virtual const bool IsPaused() = 0;
00047 virtual void Stop() = 0;
00049 virtual void Pause() = 0;
00050
00052 virtual void SetVolume(const float volume) = 0;
00053 virtual const float GetVolume() = 0;
00054
00056 virtual void SetMinMaxDistance(const float min, const float max) = 0;
00057 virtual void GetMinMaxDistance(float &min, float &max) = 0;
00058
00059
00061
00063 virtual bool Is3D() = 0;
00064
00066 virtual void SetPosition(const float x, const float y, const float z) = 0;
00068 virtual void SetVelocity(const float x, const float y, const float z) = 0;
00069
00071 virtual void GetPosition(float &x, float &y, float &z) = 0;
00073 virtual void GetVelocity(float &x, float &y, float &z) = 0;
00074
00075
00076 static void LuaRegister (lua_State *L);
00077 };
00078
00079 class cSoundSystem : public cSmartPointable {
00080 protected:
00081 cSoundSystem(){};
00082 public:
00083 virtual ~cSoundSystem(){};
00084
00086 virtual void SetListenerPosition(const float x, const float y, const float z) = 0;
00088 virtual void SetListenerVelocity(const float x, const float y, const float z) = 0;
00090 virtual void GetListenerPosition(float &x, float &y, float &z) = 0;
00092 virtual void GetListenerVelocity(float &x, float &y, float &z) = 0;
00093
00095 virtual void SetVolume(const float volume) = 0;
00096 virtual const float GetVolume() = 0;
00097
00100 virtual void SetDistanceFactor(const float s) = 0;
00101 virtual const float GetDistanceFactor() = 0;
00102
00104 virtual cSoundSource *CreateSoundSource(const char *filename) = 0;
00106 virtual cSoundSource *CreateSoundSource(const char *buffer, const int size, const int channels, const int bitrate, const int frequency) = 0;
00107
00109 virtual cSoundSource *CreateSoundSource3D(const float x, const float y, const float z, const char *filename) = 0;
00111 virtual cSoundSource *CreateSoundSource3D(const float x, const float y, const float z, const char *buffer, const int size, const int channels, const int bitrate, const int frequency) = 0;
00112
00114 virtual void Step() = 0;
00115
00116
00117 static void LuaRegister (lua_State *L);
00118 };
00119
00123 cSoundSystem *CreateSoundSystem(const char *name, const int frequency);
00124
00125 };
00126
00127 #endif