aboutsummaryrefslogtreecommitdiffstats
path: root/core/async_event.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-12-16 18:41:47 -0800
committerChris Robinson <[email protected]>2022-12-16 18:41:47 -0800
commitd281ffa9ce3abd8dfd5afd72914acebe4a4a92ff (patch)
tree59612d00cc9efa076c3565a743eab93378532326 /core/async_event.h
parent84cfef8513b88068e8ef66223d09b6c48d35caad (diff)
Use a bitset for the enabled event flags
Diffstat (limited to 'core/async_event.h')
-rw-r--r--core/async_event.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/async_event.h b/core/async_event.h
index 750f38c9..5a2f5f91 100644
--- a/core/async_event.h
+++ b/core/async_event.h
@@ -10,16 +10,17 @@ using uint = unsigned int;
struct AsyncEvent {
enum : uint {
- /* End event thread processing. */
- KillThread = 0,
-
/* User event types. */
- SourceStateChange = 1<<0,
- BufferCompleted = 1<<1,
- Disconnected = 1<<2,
+ SourceStateChange,
+ BufferCompleted,
+ Disconnected,
+ UserEventCount,
- /* Internal events. */
- ReleaseEffectState = 65536,
+ /* Internal events, always processed. */
+ ReleaseEffectState = 128,
+
+ /* End event thread processing. */
+ KillThread,
};
enum class SrcState {
@@ -29,7 +30,7 @@ struct AsyncEvent {
Pause
};
- uint EnumType{0u};
+ const uint EnumType;
union {
char dummy;
struct {
@@ -46,7 +47,6 @@ struct AsyncEvent {
EffectState *mEffectState;
} u{};
- AsyncEvent() noexcept = default;
constexpr AsyncEvent(uint type) noexcept : EnumType{type} { }
DISABLE_ALLOC()