]> git.tdb.fi Git - ext/openal.git/blob - core/async_event.h
Import OpenAL Soft 1.23.1 sources
[ext/openal.git] / core / async_event.h
1 #ifndef CORE_EVENT_H
2 #define CORE_EVENT_H
3
4 #include "almalloc.h"
5
6 struct EffectState;
7
8 using uint = unsigned int;
9
10
11 struct AsyncEvent {
12     enum : uint {
13         /* User event types. */
14         SourceStateChange,
15         BufferCompleted,
16         Disconnected,
17         UserEventCount,
18
19         /* Internal events, always processed. */
20         ReleaseEffectState = 128,
21
22         /* End event thread processing. */
23         KillThread,
24     };
25
26     enum class SrcState {
27         Reset,
28         Stop,
29         Play,
30         Pause
31     };
32
33     const uint EnumType;
34     union {
35         char dummy;
36         struct {
37             uint id;
38             SrcState state;
39         } srcstate;
40         struct {
41             uint id;
42             uint count;
43         } bufcomp;
44         struct {
45             char msg[244];
46         } disconnect;
47         EffectState *mEffectState;
48     } u{};
49
50     constexpr AsyncEvent(uint type) noexcept : EnumType{type} { }
51
52     DISABLE_ALLOC()
53 };
54
55 #endif