]> git.localhorst.tv Git - gong.git/blob - src/audio/Sound.hpp
code, assets, and other stuff stolen from blank
[gong.git] / src / audio / Sound.hpp
1 #ifndef GONG_AUDIO_SOUND_HPP_
2 #define GONG_AUDIO_SOUND_HPP_
3
4 #include <al.h>
5
6
7 namespace gong {
8 namespace audio {
9
10 class Sound {
11
12 public:
13         Sound();
14         explicit Sound(const char *);
15         ~Sound();
16
17         Sound(Sound &&);
18         Sound &operator =(Sound &&);
19
20         Sound(const Sound &) = delete;
21         Sound &operator =(const Sound &) = delete;
22
23 public:
24         void Bind(ALuint src) const;
25
26         /// full duration in milliseconds
27         int Duration() const noexcept { return duration; }
28
29 private:
30         ALuint handle;
31         int duration;
32
33 };
34
35 }
36 }
37
38 #endif