Move assume_aligned to opthelpers.h and define force_inline
[openal-soft.git] / core / async_event.h
blob750f38c9c0a86ad0324024b0372f46cb877e326a
1 #ifndef CORE_EVENT_H
2 #define CORE_EVENT_H
4 #include "almalloc.h"
6 struct EffectState;
8 using uint = unsigned int;
11 struct AsyncEvent {
12 enum : uint {
13 /* End event thread processing. */
14 KillThread = 0,
16 /* User event types. */
17 SourceStateChange = 1<<0,
18 BufferCompleted = 1<<1,
19 Disconnected = 1<<2,
21 /* Internal events. */
22 ReleaseEffectState = 65536,
25 enum class SrcState {
26 Reset,
27 Stop,
28 Play,
29 Pause
32 uint EnumType{0u};
33 union {
34 char dummy;
35 struct {
36 uint id;
37 SrcState state;
38 } srcstate;
39 struct {
40 uint id;
41 uint count;
42 } bufcomp;
43 struct {
44 char msg[244];
45 } disconnect;
46 EffectState *mEffectState;
47 } u{};
49 AsyncEvent() noexcept = default;
50 constexpr AsyncEvent(uint type) noexcept : EnumType{type} { }
52 DISABLE_ALLOC()
55 #endif