Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Audio.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_AUDIO_HPP
8 #define NAZARA_AUDIO_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Audio/Config.hpp>
12 #include <Nazara/Audio/Enums.hpp>
13 #include <Nazara/Math/Quaternion.hpp>
14 #include <Nazara/Math/Vector3.hpp>
15 
16 namespace Nz
17 {
18  class NAZARA_AUDIO_API Audio
19  {
20  public:
21  Audio() = delete;
22  ~Audio() = delete;
23 
24  static AudioFormat GetAudioFormat(unsigned int channelCount);
25  static float GetDopplerFactor();
26  static float GetGlobalVolume();
27  static Vector3f GetListenerDirection();
28  static Vector3f GetListenerPosition();
29  static Quaternionf GetListenerRotation();
30  static Vector3f GetListenerVelocity();
31  static float GetSpeedOfSound();
32 
33  static bool Initialize();
34 
35  static bool IsFormatSupported(AudioFormat format);
36  static bool IsInitialized();
37 
38  static void SetDopplerFactor(float dopplerFactor);
39  static void SetGlobalVolume(float volume);
40  static void SetListenerDirection(const Vector3f& direction);
41  static void SetListenerDirection(float dirX, float dirY, float dirZ);
42  static void SetListenerPosition(const Vector3f& position);
43  static void SetListenerPosition(float x, float y, float z);
44  static void SetListenerRotation(const Quaternionf& rotation);
45  static void SetListenerVelocity(const Vector3f& velocity);
46  static void SetListenerVelocity(float velX, float velY, float velZ);
47  static void SetSpeedOfSound(float speed);
48 
49  static void Uninitialize();
50 
51  private:
52  static unsigned int s_moduleReferenceCounter;
53  };
54 }
55 
56 #endif // NAZARA_AUDIO_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
AudioFormat
WARNING: The integer value is the number of canals owned by the format.
Definition: Enums.hpp:12
Audio class that represents the module initializer of Audio.
Definition: Audio.hpp:18