diff options
author | Chris Robinson <[email protected]> | 2022-12-16 18:41:47 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-16 18:41:47 -0800 |
commit | d281ffa9ce3abd8dfd5afd72914acebe4a4a92ff (patch) | |
tree | 59612d00cc9efa076c3565a743eab93378532326 /core/async_event.h | |
parent | 84cfef8513b88068e8ef66223d09b6c48d35caad (diff) |
Use a bitset for the enabled event flags
Diffstat (limited to 'core/async_event.h')
-rw-r--r-- | core/async_event.h | 20 |
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() |