Move the event declarations to a separate header

This commit is contained in:
Chris Robinson
2019-07-29 15:57:48 -07:00
parent 0a26bab14e
commit 76d87330ec
10 changed files with 64 additions and 49 deletions
+1
View File
@@ -622,6 +622,7 @@ SET(OPENAL_OBJS
al/alSource.h
al/alState.cpp
al/event.cpp
al/event.h
)
SET(ALC_OBJS
alc/alc.cpp
+1 -1
View File
@@ -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"
+1
View File
@@ -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"
+1 -1
View File
@@ -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"
+2 -1
View File
@@ -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"
+55
View File
@@ -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
+1
View File
@@ -74,6 +74,7 @@
#include "compat.h"
#include "cpu_caps.h"
#include "effects/base.h"
#include "event.h"
#include "filters/nfc.h"
#include "filters/splitter.h"
#include "fpu_modes.h"
-46
View File
@@ -461,48 +461,6 @@ struct ALCdevice {
#define RECORD_THREAD_NAME "alsoft-record"
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 AllocateVoices(ALCcontext *context, size_t num_voices);
@@ -525,10 +483,6 @@ inline ALint GetChannelIdxByName(const RealMixParams &real, Channel chan) noexce
{ return real.ChannelIndex[chan]; }
void StartEventThrd(ALCcontext *ctx);
void StopEventThrd(ALCcontext *ctx);
al::vector<std::string> SearchDataFiles(const char *match, const char *subdir);
#endif
+1
View File
@@ -60,6 +60,7 @@
#include "bs2b.h"
#include "cpu_caps.h"
#include "effects/base.h"
#include "event.h"
#include "filters/biquad.h"
#include "filters/nfc.h"
#include "filters/splitter.h"
+1
View File
@@ -50,6 +50,7 @@
#include "alspan.h"
#include "alu.h"
#include "cpu_caps.h"
#include "event.h"
#include "filters/biquad.h"
#include "filters/nfc.h"
#include "filters/splitter.h"