#ifndef CORE_EVENT_H #define CORE_EVENT_H #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 { char msg[244]; }; struct AsyncEffectReleaseEvent { EffectState *mEffectState; }; using AsyncEvent = std::variant; template auto &InitAsyncEvent(AsyncEvent *evt, Args&& ...args) { return std::get(*al::construct_at(evt, std::in_place_type, std::forward(args)...)); } #endif