aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-07-29 15:57:48 -0700
committerChris Robinson <[email protected]>2019-07-29 15:58:26 -0700
commit76d87330ec7c34efeee86654db4c6ed405810de2 (patch)
tree2974a301ee77d0022a0b7c9b1e78ff4402355d5b /al
parent0a26bab14e0100b883f59958f3ce417888cebc62 (diff)
Move the event declarations to a separate header
Diffstat (limited to 'al')
-rw-r--r--al/alError.cpp2
-rw-r--r--al/alSource.cpp1
-rw-r--r--al/alState.cpp2
-rw-r--r--al/event.cpp3
-rw-r--r--al/event.h55
5 files changed, 60 insertions, 3 deletions
diff --git a/al/alError.cpp b/al/alError.cpp
index 159aee52..bff92444 100644
--- a/al/alError.cpp
+++ b/al/alError.cpp
@@ -37,10 +37,10 @@
#include "AL/al.h"
#include "AL/alc.h"
-#include "alcmain.h"
#include "alcontext.h"
#include "alexcpt.h"
#include "almalloc.h"
+#include "event.h"
#include "inprogext.h"
#include "logging.h"
#include "opthelpers.h"
diff --git a/al/alSource.cpp b/al/alSource.cpp
index 4af5cc47..fdd063ac 100644
--- a/al/alSource.cpp
+++ b/al/alSource.cpp
@@ -59,6 +59,7 @@
#include "atomic.h"
#include "backends/base.h"
#include "bformatdec.h"
+#include "event.h"
#include "filters/nfc.h"
#include "filters/splitter.h"
#include "inprogext.h"
diff --git a/al/alState.cpp b/al/alState.cpp
index ee8d3a1c..001412a8 100644
--- a/al/alState.cpp
+++ b/al/alState.cpp
@@ -33,13 +33,13 @@
#include "AL/alext.h"
#include "alError.h"
-#include "alcmain.h"
#include "alcontext.h"
#include "alexcpt.h"
#include "almalloc.h"
#include "alspan.h"
#include "alu.h"
#include "atomic.h"
+#include "event.h"
#include "inprogext.h"
#include "opthelpers.h"
diff --git a/al/event.cpp b/al/event.cpp
index d50cef2e..44d825c6 100644
--- a/al/event.cpp
+++ b/al/event.cpp
@@ -1,6 +1,8 @@
#include "config.h"
+#include "event.h"
+
#include <algorithm>
#include <atomic>
#include <cstring>
@@ -16,7 +18,6 @@
#include "alError.h"
#include "albyte.h"
-#include "alcmain.h"
#include "alcontext.h"
#include "alexcpt.h"
#include "almalloc.h"
diff --git a/al/event.h b/al/event.h
new file mode 100644
index 00000000..e98be560
--- /dev/null
+++ b/al/event.h
@@ -0,0 +1,55 @@
+#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;
+ ALsizei count;
+ } bufcomp;
+ struct {
+ ALenum type;
+ ALuint id;
+ ALuint param;
+ ALchar msg[1008];
+ } user;
+ EffectState *mEffectState;
+ } u{};
+
+ AsyncEvent() noexcept = default;
+ constexpr AsyncEvent(unsigned int type) noexcept : EnumType{type} { }
+};
+
+
+void StartEventThrd(ALCcontext *ctx);
+void StopEventThrd(ALCcontext *ctx);
+
+#endif