-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSoundSystem.h
More file actions
54 lines (48 loc) · 1.57 KB
/
Copy pathSoundSystem.h
File metadata and controls
54 lines (48 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include "Export.h"
#include "Core/Singleton.hpp"
#include <array>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
namespace sh::sound
{
class SoundSystem : public core::Singleton<SoundSystem>
{
friend core::Singleton<SoundSystem>;
public:
enum class DistanceModel
{
None,
InverseDistance,
InverseDistanceClamped,
LinearDistance,
LinearDistanceClamped,
ExponentDistance,
ExponentDistanceClamped
};
public:
SH_SOUND_API void Init(std::string_view deviceName = {});
SH_SOUND_API void Shutdown();
SH_SOUND_API void SetListenerGain(float gain);
SH_SOUND_API auto GetListenerGain() const -> float;
SH_SOUND_API void SetListenerPosition(float x, float y, float z);
SH_SOUND_API void SetListenerVelocity(float x, float y, float z);
SH_SOUND_API void SetListenerOrientation(const std::array<float, 3>& at, const std::array<float, 3>& up);
SH_SOUND_API void SetDistanceModel(DistanceModel model);
SH_SOUND_API auto GetDeviceName() const -> std::string;
SH_SOUND_API auto GetListenerPosition() const -> std::array<float, 3>;
SH_SOUND_API auto GetListenerForward() const -> std::array<float, 3>;
SH_SOUND_API auto GetListenerUp() const -> std::array<float, 3>;
SH_SOUND_API auto IsInit() const noexcept -> bool;
SH_SOUND_API static auto GetDefaultDeviceName() -> std::string;
SH_SOUND_API static auto EnumeratePlaybackDevices() -> std::vector<std::string>;
protected:
SH_SOUND_API SoundSystem();
SH_SOUND_API ~SoundSystem();
private:
struct Impl;
std::unique_ptr<Impl> impl;
};
}//namespace