🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
993 B

  1. #ifndef CORE_EVENT_H
  2. #define CORE_EVENT_H
  3. #include "almalloc.h"
  4. struct EffectState;
  5. using uint = unsigned int;
  6. struct AsyncEvent {
  7. enum : uint {
  8. /* End event thread processing. */
  9. KillThread = 0,
  10. /* User event types. */
  11. SourceStateChange = 1<<0,
  12. BufferCompleted = 1<<1,
  13. Disconnected = 1<<2,
  14. /* Internal events. */
  15. ReleaseEffectState = 65536,
  16. };
  17. enum class SrcState {
  18. Reset,
  19. Stop,
  20. Play,
  21. Pause
  22. };
  23. uint EnumType{0u};
  24. union {
  25. char dummy;
  26. struct {
  27. uint id;
  28. SrcState state;
  29. } srcstate;
  30. struct {
  31. uint id;
  32. uint count;
  33. } bufcomp;
  34. struct {
  35. char msg[244];
  36. } disconnect;
  37. EffectState *mEffectState;
  38. } u{};
  39. AsyncEvent() noexcept = default;
  40. constexpr AsyncEvent(uint type) noexcept : EnumType{type} { }
  41. DISABLE_ALLOC()
  42. };
  43. #endif