Team Fortress 2 Source Code as on 22/4/2020
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.

234 lines
5.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Posix win32 replacements - Mocks trivial windows flow
  4. //
  5. //=============================================================================
  6. #ifndef POSIX_AUDIO_STUBS_H
  7. #define POSIX_AUDIO_STUBS_H
  8. #define DSBCAPS_LOCSOFTWARE 0
  9. #define DSERR_BUFFERLOST 0
  10. #define DSBSTATUS_BUFFERLOST 0x02
  11. #define DSSPEAKER_GEOMETRY(x) (((x)>>16) & 0xFFFF)
  12. #define DSSPEAKER_CONFIG(x) ((x) & 0xFFFF)
  13. #define DSSPEAKER_HEADPHONE -1
  14. #define DSSPEAKER_QUAD -2
  15. #define DSSPEAKER_5POINT1 -3
  16. #define DSSPEAKER_7POINT1 -4
  17. #define DISP_CHANGE_SUCCESSFUL 0
  18. #define HKEY_CURRENT_USER NULL
  19. #define HKEY_LOCAL_MACHINE NULL
  20. #define KEY_QUERY_VALUE 0
  21. #define KEY_READ 0
  22. #define KEY_WRITE 1
  23. #define KEY_ALL_ACCESS ((ULONG)-1)
  24. #define SMTO_ABORTIFHUNG 0
  25. #define JOY_RETURNX 0x01
  26. #define JOY_RETURNY 0x02
  27. #define JOY_RETURNZ 0x04
  28. #define JOY_RETURNR 0x08
  29. #define JOY_RETURNU 0x10
  30. #define JOY_RETURNV 0x20
  31. #define JOYCAPS_HASPOV 0x01
  32. #define JOYCAPS_HASU 0x01
  33. #define JOYCAPS_HASV 0x01
  34. #define JOYCAPS_HASR 0x01
  35. #define JOYCAPS_HASZ 0x01
  36. #define MMSYSERR_NODRIVER 1
  37. #define JOYERR_NOERROR 0
  38. #define JOY_RETURNCENTERED 0
  39. #define JOY_RETURNBUTTONS 0
  40. #define JOY_RETURNPOV 0
  41. #define JOY_POVCENTERED 0
  42. #define JOY_POVFORWARD 0
  43. #define JOY_POVRIGHT 0
  44. #define JOY_POVBACKWARD 0
  45. #define JOY_POVLEFT 0
  46. #define CCHDEVICENAME 32
  47. #define CCHFORMNAME 32
  48. typedef wchar_t BCHAR;
  49. typedef uint MMRESULT;
  50. typedef uint32 *DWORD_PTR;
  51. typedef char *LPCSTR;
  52. typedef uint POINTL;
  53. #define IDLE_PRIORITY_CLASS 1
  54. #define HIGH_PRIORITY_CLASS 2
  55. typedef struct _devicemode {
  56. BCHAR dmDeviceName[CCHDEVICENAME];
  57. WORD dmSpecVersion;
  58. WORD dmDriverVersion;
  59. WORD dmSize;
  60. WORD dmDriverExtra;
  61. DWORD dmFields;
  62. union u1 {
  63. struct s {
  64. short dmOrientation;
  65. short dmPaperSize;
  66. short dmPaperLength;
  67. short dmPaperWidth;
  68. short dmScale;
  69. short dmCopies;
  70. short dmDefaultSource;
  71. short dmPrintQuality;
  72. };
  73. POINTL dmPosition;
  74. DWORD dmDisplayOrientation;
  75. DWORD dmDisplayFixedOutput;
  76. };
  77. short dmColor;
  78. short dmDuplex;
  79. short dmYResolution;
  80. short dmTTOption;
  81. short dmCollate;
  82. BYTE dmFormName[CCHFORMNAME];
  83. WORD dmLogPixels;
  84. DWORD dmBitsPerPel;
  85. DWORD dmPelsWidth;
  86. DWORD dmPelsHeight;
  87. union u2 {
  88. DWORD dmDisplayFlags;
  89. DWORD dmNup;
  90. };
  91. DWORD dmDisplayFrequency;
  92. DWORD dmICMMethod;
  93. DWORD dmICMIntent;
  94. DWORD dmMediaType;
  95. DWORD dmDitherType;
  96. DWORD dmReserved1;
  97. DWORD dmReserved2;
  98. DWORD dmPanningWidth;
  99. DWORD dmPanningHeight;
  100. } DEVMODE, *LPDEVMODE;
  101. typedef uint32 MCIERROR;
  102. typedef uint MCIDEVICEID;
  103. typedef struct {
  104. DWORD_PTR dwCallback;
  105. } MCI_GENERIC_PARMS;
  106. typedef struct {
  107. DWORD_PTR dwCallback;
  108. DWORD dwReturn;
  109. DWORD dwItem;
  110. DWORD dwTrack;
  111. } MCI_STATUS_PARMS;
  112. typedef struct {
  113. DWORD_PTR dwCallback;
  114. DWORD dwFrom;
  115. DWORD dwTo;
  116. } MCI_PLAY_PARMS;
  117. typedef struct {
  118. DWORD_PTR dwCallback;
  119. MCIDEVICEID wDeviceID;
  120. LPCSTR lpstrDeviceType;
  121. LPCSTR lpstrElementName;
  122. LPCSTR lpstrAlias;
  123. } MCI_OPEN_PARMS;
  124. typedef struct {
  125. DWORD_PTR dwCallback;
  126. DWORD dwTimeFormat;
  127. DWORD dwAudio;
  128. } MCI_SET_PARMS;
  129. #define MCI_MAKE_TMSF(t, m, s, f) ((DWORD)(((BYTE)(t) | ((WORD)(m) << 8)) | ((DWORD)(BYTE)(s) | ((WORD)(f)<<8)) << 16))
  130. #define MCI_MSF_MINUTE(msf) ((BYTE)(msf))
  131. #define MCI_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
  132. #define MCI_OPEN 0
  133. #define MCI_OPEN_TYPE 0
  134. #define MCI_OPEN_SHAREABLE 0
  135. #define MCI_FORMAT_TMSF 0
  136. #define MCI_SET_TIME_FORMAT 0
  137. #define MCI_CLOSE 0
  138. #define MCI_STOP 0
  139. #define MCI_PAUSE 0
  140. #define MCI_PLAY 0
  141. #define MCI_SET 0
  142. #define MCI_SET_DOOR_OPEN 0
  143. #define MCI_SET_DOOR_CLOSED 0
  144. #define MCI_STATUS_READY 0
  145. #define MCI_STATUS 0
  146. #define MCI_STATUS_ITEM 0
  147. #define MCI_STATUS_WAIT 0
  148. #define MCI_STATUS_NUMBER_OF_TRACKS 0
  149. #define MCI_CDA_STATUS_TYPE_TRACK 0
  150. #define MCI_TRACK 0
  151. #define MCI_WAIT 0
  152. #define MCI_CDA_TRACK_AUDIO 0
  153. #define MCI_STATUS_LENGTH 0
  154. #define MCI_NOTIFY 0
  155. #define MCI_FROM 0
  156. #define MCI_TO 0
  157. #define MCIERR_DRIVER -1
  158. #define DSERR_ALLOCATED 0
  159. #pragma pack(push, 1)
  160. typedef struct tWAVEFORMATEX
  161. {
  162. WORD wFormatTag;
  163. WORD nChannels;
  164. DWORD nSamplesPerSec;
  165. DWORD nAvgBytesPerSec;
  166. WORD nBlockAlign;
  167. WORD wBitsPerSample;
  168. WORD cbSize;
  169. } WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
  170. typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
  171. typedef struct waveformat_tag
  172. {
  173. WORD wFormatTag;
  174. WORD nChannels;
  175. DWORD nSamplesPerSec;
  176. DWORD nAvgBytesPerSec;
  177. WORD nBlockAlign;
  178. } WAVEFORMAT, *PWAVEFORMAT, *NPWAVEFORMAT, *LPWAVEFORMAT;
  179. typedef const WAVEFORMAT *LPCWAVEFORMAT;
  180. typedef struct pcmwaveformat_tag
  181. {
  182. WAVEFORMAT wf;
  183. WORD wBitsPerSample;
  184. } PCMWAVEFORMAT, *PPCMWAVEFORMAT, *NPPCMWAVEFORMAT, *LPPCMWAVEFORMAT;
  185. typedef const PCMWAVEFORMAT *LPCPCMWAVEFORMAT;
  186. typedef struct adpcmcoef_tag {
  187. short iCoef1;
  188. short iCoef2;
  189. } ADPCMCOEFSET;
  190. typedef struct adpcmwaveformat_tag {
  191. WAVEFORMATEX wfx;
  192. WORD wSamplesPerBlock;
  193. WORD wNumCoef;
  194. ADPCMCOEFSET aCoef[1];
  195. } ADPCMWAVEFORMAT;
  196. #pragma pack(pop)
  197. #endif