nomlib
Toggle main menu visibility
Loading...
Searching...
No Matches
include
nomlib
audio
ISoundSource.hpp
1
#pragma once
2
3
#include "export.hpp"
4
#include "nomlib/types.hpp"
5
#include "nomlib/math/Point3.hpp"
6
#include <vector>
7
8
9
namespace
nom {
10
namespace
audio {
11
12
// Forward declarations
13
class
Sound
;
14
15
struct
OALSource {
16
nom::uint32 source;
17
bool
used;
18
19
OALSource(nom::uint32 src) {
20
source = src;
21
used =
false
;
22
}
23
};
24
25
enum
SoundPriority: nom::uint32 {
26
SOUND_PRIORITY_LOW = 0x00,
27
SOUND_PRIORITY_MEDIUM = 0x02,
28
SOUND_PRIORITY_HIGH = 0x04,
29
SOUND_PRIORITY_ALWAYS = 0x6,
30
};
31
32
// SoundNode
33
class
NOM_EXPORT ISoundSource
34
{
35
public
:
36
virtual
void
reset();
37
virtual
~ISoundSource();
38
39
Sound
* sound();
40
SoundPriority priority();
41
42
nom::uint32 state();
43
nom::real32 volume();
44
nom::real32 pitch();
45
nom::real32 radius();
46
bool
looping();
47
bool
global();
48
nom::real64 time_left();
49
nom::Point3f& position();
50
51
void
set_priority(SoundPriority p);
52
virtual
void
set_volume(nom::real32 gain);
53
void
set_pitch(nom::real32 pitch);
54
void
set_looping(
bool
state);
55
void
set_radius(nom::real32 value);
56
void
set_global(
bool
state);
57
void
set_position(
const
nom::Point3f& pos);
58
void
set_position(nom::real32 x, nom::real32 y, nom::real32 z);
59
60
// Update(real32);
61
virtual
void
update(nom::real32 delta) = 0;
62
virtual
void
update_state(nom::real32 delta) = 0;
63
virtual
void
attach_source(
OALSource
* s) = 0;
64
virtual
void
detach_source() = 0;
65
virtual
OALSource
* source() = 0;
66
virtual
void
set_sound(
Sound
*s) = 0;
67
protected
:
68
ISoundSource();
69
70
Sound
* sound_;
71
SoundPriority priority_;
72
nom::uint32 state_;
73
nom::real32 volume_;
74
nom::real32 pitch_;
75
nom::real32 radius_;
76
bool
looping_;
77
bool
global_;
78
nom::real64 time_left_;
79
nom::Point3f position_;
80
};
81
82
using
SoundSourceIterator = std::vector<ISoundSource*>::iterator;
83
84
}
// namespace audio
85
}
// namespace nom
nom::audio::Sound
Definition
Sound.hpp:28
nom::audio::OALSource
Definition
ISoundSource.hpp:15
Generated on
for nomlib by
1.18.0