aboutsummaryrefslogtreecommitdiffstats
path: root/alc/async_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'alc/async_event.h')
-rw-r--r--alc/async_event.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/alc/async_event.h b/alc/async_event.h
new file mode 100644
index 00000000..1ee58b10
--- /dev/null
+++ b/alc/async_event.h
@@ -0,0 +1,49 @@
+#ifndef ALC_EVENT_H
+#define ALC_EVENT_H
+
+#include "almalloc.h"
+
+struct EffectState;
+enum class VChangeState;
+
+using uint = unsigned int;
+
+
+enum {
+ /* End event thread processing. */
+ EventType_KillThread = 0,
+
+ /* User event types. */
+ EventType_SourceStateChange = 1<<0,
+ EventType_BufferCompleted = 1<<1,
+ EventType_Disconnected = 1<<2,
+
+ /* Internal events. */
+ EventType_ReleaseEffectState = 65536,
+};
+
+struct AsyncEvent {
+ uint EnumType{0u};
+ union {
+ char dummy;
+ struct {
+ uint id;
+ VChangeState state;
+ } srcstate;
+ struct {
+ uint id;
+ uint count;
+ } bufcomp;
+ struct {
+ char msg[244];
+ } disconnect;
+ EffectState *mEffectState;
+ } u{};
+
+ AsyncEvent() noexcept = default;
+ constexpr AsyncEvent(uint type) noexcept : EnumType{type} { }
+
+ DISABLE_ALLOC()
+};
+
+#endif