Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
SoundEmitter.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Audio module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_SOUNDEMITTER_HPP
8 #define NAZARA_SOUNDEMITTER_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Audio/Config.hpp>
12 #include <Nazara/Audio/Enums.hpp>
13 #include <Nazara/Math/Vector3.hpp>
14 
16 
17 namespace Nz
18 {
19  class NAZARA_AUDIO_API SoundEmitter
20  {
21  public:
22  virtual ~SoundEmitter();
23 
24  virtual void EnableLooping(bool loop) = 0;
25  void EnableSpatialization(bool spatialization);
26 
27  float GetAttenuation() const;
28  virtual UInt32 GetDuration() const = 0;
29  float GetMinDistance() const;
30  float GetPitch() const;
31  virtual UInt32 GetPlayingOffset() const = 0;
32  Vector3f GetPosition() const;
33  Vector3f GetVelocity() const;
34  virtual SoundStatus GetStatus() const = 0;
35  float GetVolume() const;
36 
37  virtual bool IsLooping() const = 0;
38  bool IsSpatialized() const;
39 
40  virtual void Pause() = 0;
41  virtual void Play() = 0;
42 
43  void SetAttenuation(float attenuation);
44  void SetMinDistance(float minDistance);
45  void SetPitch(float pitch);
46  void SetPosition(const Vector3f& position);
47  void SetPosition(float x, float y, float z);
48  void SetVelocity(const Vector3f& velocity);
49  void SetVelocity(float velX, float velY, float velZ);
50  void SetVolume(float volume);
51 
52  virtual void Stop() = 0;
53 
54  SoundEmitter& operator=(const SoundEmitter&) = delete;
55  SoundEmitter& operator=(SoundEmitter&&) = delete;
56 
57  protected:
58  SoundEmitter();
59  SoundEmitter(const SoundEmitter& emitter);
60  SoundEmitter(SoundEmitter&&) = delete;
61 
62  SoundStatus GetInternalStatus() const;
63 
64  unsigned int m_source;
65  };
66 }
67 #endif // NAZARA_SOUNDEMITTER_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Audio class that represents a sound source, that emits sound.
Definition: SoundEmitter.hpp:19