Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
3DSound.h
Go to the documentation of this file.
1 // File name: structs.h
2 // Des: in file inteface asli kar ba sedaye 3D hast
3 // Date: 20/5/1386
4 // Programmer: Pooya Shahinfar (Pswin)
5 
6 
7 #include "../../Libs/al/al.h"
8 #include "../../Libs/al/alc.h"
9 #include "../../Libs/al/alut.h"
10 
11 #include <vector>
12 #include "../math/vector.h"
13 
14 
15 namespace kge
16 {
17  namespace sfx
18  {
19  namespace Sound3D
20  {
23  {
24  private:
25  ALuint Source;
26  public:
28  SoundSource();
29 
31  ~SoundSource();
32 
33  // mogeiate manbae
34  void SetPosition (math::Vector pos);
35  math::Vector GetPosition ();
36 
37  // VELOCITY manbae
38  void SetVelocity(math::Vector velocity);
39  math::Vector GetVelocity();
40 
41  // voulome manbae
42  void SetVolume (float value,SourceVolumeFactor factor = SVF_GAIN);
43  float GetVolume (SourceVolumeFactor factor = SVF_GAIN);
44 
45  // sorate pakhshe manbae
46  void SetPitch(float value);
47  float GetPitch();
48 
49  //parametr haye mohasebe gain nesbat be fasle manbae az shenavande
50  float GetDistanceFactor (SourceDistanceFactor factor );
51  void SetDistanceFactor (SourceDistanceFactor factor,float value);
52 
53  // loop manbae
54  bool GetLoop();
55  void SetLoop(bool looping);
56 
57  // vaziate manbae
58  SourceStates GetState();
59 
60  // zamime kadane bufferha
61  void AttachBuffer(ALuint buffer);
62  void AttachFromFile(char* filename);
63 
64  // hazfe buffer attach shode
65  void RemoveBuffer(int i);
66 
67  // bool AttachBufferQueue (); "in the next reversion"
68 
69  //noe manbae (static,streaming...)
70  SourceType GetType();
71 
72  //pakhshe seda az manbae
73  void Play();
74 
75  //makse pakhshe seda
76  void Pause();
77 
78  //iste pakhshe seda
79  void Stop();
80 
81  };
82 
85  {
86 
87  public:
88  // buffer
89  ALuint Buffer;
90 
92  SoundBuffer();
93 
95  ~SoundBuffer();
96 
98  void LoadFromFile(char* filename);
99 
100  };
101 
104  {
105  public:
107  Listener(){};
108 
111 
113  math::Vector GetPostion();
114 
116  void SetPostion(math::Vector pos);
117 
119  void SetOrientation(math::Vector up,math::Vector at);
120 
122  void SetVelocity(math::Vector vel);
123  math::Vector GetVelocity();
124 
126  void SetGain(float value);
127  float GetGain();
128 
130  void SetDistanceModel(DistanceGainType model);
131 
132  };
133 
134  } //end of name sapcae 3DSound
135 
136  }// end of namesapce sfx
137 
138 } // end of namspace kge
139 
140 #endif // KGE_STRUCTS_AV_H