MOS
source.hpp
1 #pragma once
2 
3 #include <atomic>
4 #include <glm/vec3.hpp>
5 #include <mos/aud/source.hpp>
6 
7 namespace mos::al {
8 class Renderer;
9 }
10 
11 namespace mos::apu {
12 
14 class Source final {
15  friend class mos::al::Renderer;
16  friend class Sound;
17  friend class Sound_stream;
18 private:
19  explicit Source(const aud::Source &source);
20 
21 public:
22 
24  auto id() const -> unsigned int;
25 
27  glm::vec3 position{glm::vec3(0.0f)};
28 
30  glm::vec3 velocity{glm::vec3(0.0f)};
31 
33  float pitch{1.0f};
34 
36  float gain{1.0f};
37 
39  bool loop{false};
40 
42  bool playing{false};
43 
45  float obstructed{0.0f};
46 private:
47  unsigned int id_;
48 };
49 }
Definition: buffer.hpp:13
Base class for the audio source.
Definition: source.hpp:9
Definition: sound.hpp:14
Source living on the APU.
Definition: source.hpp:14
OpenAL audio renderer.
Definition: renderer.hpp:35
Definition: renderer.hpp:28
Streamed audio from file, combined with a source living on the APU.
Definition: sound_stream.hpp:10