ASAPI.h 831 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. struct ASAPI_ServerMessage {
  3. enum class Type {
  4. Invalid,
  5. Greeting,
  6. PlayingBuffer,
  7. FinishedPlayingBuffer,
  8. EnqueueBufferResponse,
  9. };
  10. Type type { Type::Invalid };
  11. unsigned extra_size { 0 };
  12. bool success { true };
  13. union {
  14. struct {
  15. int server_pid;
  16. int your_client_id;
  17. } greeting;
  18. struct {
  19. int buffer_id;
  20. } playing_buffer;
  21. };
  22. };
  23. struct ASAPI_ClientMessage {
  24. enum class Type {
  25. Invalid,
  26. Greeting,
  27. PlayBuffer,
  28. EnqueueBuffer,
  29. };
  30. Type type { Type::Invalid };
  31. unsigned extra_size { 0 };
  32. union {
  33. struct {
  34. int client_pid;
  35. } greeting;
  36. struct {
  37. int buffer_id;
  38. } play_buffer;
  39. };
  40. };