axmol/thirdparty/openal/core/async_event.h

56 lines
966 B
C
Raw Normal View History

2021-05-14 10:15:42 +08:00
#ifndef CORE_EVENT_H
#define CORE_EVENT_H
#include "almalloc.h"
struct EffectState;
using uint = unsigned int;
2022-04-25 12:02:45 +08:00
struct AsyncEvent {
enum : uint {
/* User event types. */
2023-02-04 15:03:54 +08:00
SourceStateChange,
BufferCompleted,
Disconnected,
UserEventCount,
2021-05-14 10:15:42 +08:00
2023-02-04 15:03:54 +08:00
/* Internal events, always processed. */
ReleaseEffectState = 128,
/* End event thread processing. */
KillThread,
2022-04-25 12:02:45 +08:00
};
2021-05-14 10:15:42 +08:00
enum class SrcState {
Reset,
Stop,
Play,
Pause
};
2023-02-04 15:03:54 +08:00
const uint EnumType;
2021-05-14 10:15:42 +08:00
union {
char dummy;
struct {
uint id;
SrcState state;
} srcstate;
struct {
uint id;
uint count;
} bufcomp;
struct {
char msg[244];
} disconnect;
EffectState *mEffectState;
} u{};
constexpr AsyncEvent(uint type) noexcept : EnumType{type} { }
DISABLE_ALLOC()
};
#endif