#ifndef CORE_EVENT_H #define CORE_EVENT_H #include #include #include #include "almalloc.h" struct EffectState; using uint = unsigned int; enum class AsyncEnableBits : uint8_t { SourceState, BufferCompleted, Disconnected, Count }; enum class AsyncSrcState : uint8_t { Reset, Stop, Play, Pause }; using AsyncKillThread = std::monostate; struct AsyncSourceStateEvent { uint mId; AsyncSrcState mState; }; struct AsyncBufferCompleteEvent { uint mId; uint mCount; }; struct AsyncDisconnectEvent { std::array msg; }; struct AsyncEffectReleaseEvent { EffectState *mEffectState; }; using AsyncEvent = std::variant; template auto &InitAsyncEvent(std::byte *evtbuf, Args&& ...args) { auto *evt = al::construct_at(reinterpret_cast(evtbuf), std::in_place_type, std::forward(args)...); return std::get(*evt); } #endif