2019-07-29 15:57:48 -07:00
|
|
|
#ifndef AL_EVENT_H
|
|
|
|
#define AL_EVENT_H
|
|
|
|
|
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
|
|
|
|
struct EffectState;
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
/* End event thread processing. */
|
|
|
|
EventType_KillThread = 0,
|
|
|
|
|
|
|
|
/* User event types. */
|
|
|
|
EventType_SourceStateChange = 1<<0,
|
|
|
|
EventType_BufferCompleted = 1<<1,
|
|
|
|
EventType_Error = 1<<2,
|
|
|
|
EventType_Performance = 1<<3,
|
|
|
|
EventType_Deprecated = 1<<4,
|
|
|
|
EventType_Disconnected = 1<<5,
|
|
|
|
|
|
|
|
/* Internal events. */
|
|
|
|
EventType_ReleaseEffectState = 65536,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AsyncEvent {
|
|
|
|
unsigned int EnumType{0u};
|
|
|
|
union {
|
|
|
|
char dummy;
|
|
|
|
struct {
|
|
|
|
ALuint id;
|
|
|
|
ALenum state;
|
|
|
|
} srcstate;
|
|
|
|
struct {
|
|
|
|
ALuint id;
|
2019-09-11 14:33:26 -07:00
|
|
|
ALuint count;
|
2019-07-29 15:57:48 -07:00
|
|
|
} bufcomp;
|
|
|
|
struct {
|
|
|
|
ALenum type;
|
|
|
|
ALuint id;
|
|
|
|
ALuint param;
|
2019-08-01 15:54:17 -07:00
|
|
|
ALchar msg[232];
|
2019-07-29 15:57:48 -07:00
|
|
|
} user;
|
|
|
|
EffectState *mEffectState;
|
|
|
|
} u{};
|
|
|
|
|
|
|
|
AsyncEvent() noexcept = default;
|
|
|
|
constexpr AsyncEvent(unsigned int type) noexcept : EnumType{type} { }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void StartEventThrd(ALCcontext *ctx);
|
|
|
|
void StopEventThrd(ALCcontext *ctx);
|
|
|
|
|
|
|
|
#endif
|