-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonido.hpp
More file actions
99 lines (90 loc) · 1.71 KB
/
sonido.hpp
File metadata and controls
99 lines (90 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef _SONIDO_HPP_
#define _SONIDO_HPP_
#include <AL/alut.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include "vector3d.hpp"
using namespace std;
using namespace ed;
using std::string;
class Sonido
{
private:
ALuint _buffer;
ALuint _source;
string _fichero;
vector3d _PosicionSource;
vector3d _VelocidadSource;
bool _loop;
public:
Sonido()
{
_loop = false;
}
Sonido(string fichero, vector3d PosicionSource = vector3d(0, 0, 0), vector3d VelocidadSource = vector3d(0, 0, 0), bool loop = false)
{
_fichero = fichero;
_PosicionSource = PosicionSource;
_VelocidadSource = VelocidadSource;
_loop = loop;
}
inline ALuint getBuffer() const
{
return _buffer;
}
inline ALuint getSource() const
{
return _source;
}
inline string getFichero() const
{
return _fichero;
}
inline vector3d getPosicionSource() const
{
return _PosicionSource;
}
inline vector3d getVelocidadSource() const
{
return _VelocidadSource;
}
inline bool getLoop() const
{
return _loop;
}
inline void setBuffer(ALuint buffer)
{
_buffer = buffer;
}
inline void setSource(ALuint source)
{
_source = source;
}
inline void setFichero(string fichero)
{
_fichero = fichero;
}
inline void setPosicionSource(vector3d PosicionSource)
{
_PosicionSource = PosicionSource;
}
inline void setVelocidadSource(vector3d VelocidadSource)
{
_VelocidadSource = VelocidadSource;
}
inline void setLoop(bool loop)
{
_loop = loop;
}
void actualizarSonido(vector3d posicion);
void actualizarSonido();
void definirSonidoSinDoppler();
void terminarSonido();
void leerFichero();
void reproducirSonido();
void pararSonido();
};
void initSonido(int argc, char **argv);
void listener(vector3d posicion);
#endif