Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
sound.h
1 #pragma once
2 
3 #include <memory>
4 #include <glm/glm.hpp>
5 
6 
7 namespace sf {
8  class Sound;
9  class SoundBuffer;
10 }
11 
12 class Sound {
13 public:
14  enum class Status {
15  Paused, Playing, Stopped, Null
16  };
17 
18  Sound();
19  Sound(const sf::SoundBuffer& sound);
20  ~Sound();
21 
22  Status status();
23 
24  void play();
25  void stop();
26  void pause();
27 
28  Sound& setPosition(const glm::vec3& position);
29  Sound& setVolume(float volume);
30  Sound& setAttenuation(float attenuation);
31  Sound& setLooping(bool loop);
32  Sound& setRelativeToListener(bool relative);
33  Sound& setMinDistance(float distance);
34 
35 protected:
36  std::unique_ptr<sf::Sound> m_sound;
37 };
38 
Definition: sound.h:12