libsoundio-interop.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. // This source file is generated by nclang PInvokeGenerator.
  2. using System;
  3. using System.Runtime.InteropServices;
  4. using delegate0 = SoundIOSharp.Delegates.delegate0;
  5. using delegate1 = SoundIOSharp.Delegates.delegate1;
  6. using delegate2 = SoundIOSharp.Delegates.delegate2;
  7. using delegate3 = SoundIOSharp.Delegates.delegate3;
  8. using delegate4 = SoundIOSharp.Delegates.delegate4;
  9. using delegate5 = SoundIOSharp.Delegates.delegate5;
  10. using delegate6 = SoundIOSharp.Delegates.delegate6;
  11. using delegate7 = SoundIOSharp.Delegates.delegate7;
  12. using delegate8 = SoundIOSharp.Delegates.delegate8;
  13. using delegate9 = SoundIOSharp.Delegates.delegate9;
  14. namespace SoundIOSharp
  15. {
  16. enum SoundIoError // soundio.h (72, 6)
  17. {
  18. SoundIoErrorNone = 0,
  19. SoundIoErrorNoMem = 1,
  20. SoundIoErrorInitAudioBackend = 2,
  21. SoundIoErrorSystemResources = 3,
  22. SoundIoErrorOpeningDevice = 4,
  23. SoundIoErrorNoSuchDevice = 5,
  24. SoundIoErrorInvalid = 6,
  25. SoundIoErrorBackendUnavailable = 7,
  26. SoundIoErrorStreaming = 8,
  27. SoundIoErrorIncompatibleDevice = 9,
  28. SoundIoErrorNoSuchClient = 10,
  29. SoundIoErrorIncompatibleBackend = 11,
  30. SoundIoErrorBackendDisconnected = 12,
  31. SoundIoErrorInterrupted = 13,
  32. SoundIoErrorUnderflow = 14,
  33. SoundIoErrorEncodingString = 15,
  34. }
  35. enum SoundIoChannelId // soundio.h (106, 6)
  36. {
  37. SoundIoChannelIdInvalid = 0,
  38. SoundIoChannelIdFrontLeft = 1,
  39. SoundIoChannelIdFrontRight = 2,
  40. SoundIoChannelIdFrontCenter = 3,
  41. SoundIoChannelIdLfe = 4,
  42. SoundIoChannelIdBackLeft = 5,
  43. SoundIoChannelIdBackRight = 6,
  44. SoundIoChannelIdFrontLeftCenter = 7,
  45. SoundIoChannelIdFrontRightCenter = 8,
  46. SoundIoChannelIdBackCenter = 9,
  47. SoundIoChannelIdSideLeft = 10,
  48. SoundIoChannelIdSideRight = 11,
  49. SoundIoChannelIdTopCenter = 12,
  50. SoundIoChannelIdTopFrontLeft = 13,
  51. SoundIoChannelIdTopFrontCenter = 14,
  52. SoundIoChannelIdTopFrontRight = 15,
  53. SoundIoChannelIdTopBackLeft = 16,
  54. SoundIoChannelIdTopBackCenter = 17,
  55. SoundIoChannelIdTopBackRight = 18,
  56. SoundIoChannelIdBackLeftCenter = 19,
  57. SoundIoChannelIdBackRightCenter = 20,
  58. SoundIoChannelIdFrontLeftWide = 21,
  59. SoundIoChannelIdFrontRightWide = 22,
  60. SoundIoChannelIdFrontLeftHigh = 23,
  61. SoundIoChannelIdFrontCenterHigh = 24,
  62. SoundIoChannelIdFrontRightHigh = 25,
  63. SoundIoChannelIdTopFrontLeftCenter = 26,
  64. SoundIoChannelIdTopFrontRightCenter = 27,
  65. SoundIoChannelIdTopSideLeft = 28,
  66. SoundIoChannelIdTopSideRight = 29,
  67. SoundIoChannelIdLeftLfe = 30,
  68. SoundIoChannelIdRightLfe = 31,
  69. SoundIoChannelIdLfe2 = 32,
  70. SoundIoChannelIdBottomCenter = 33,
  71. SoundIoChannelIdBottomLeftCenter = 34,
  72. SoundIoChannelIdBottomRightCenter = 35,
  73. SoundIoChannelIdMsMid = 36,
  74. SoundIoChannelIdMsSide = 37,
  75. SoundIoChannelIdAmbisonicW = 38,
  76. SoundIoChannelIdAmbisonicX = 39,
  77. SoundIoChannelIdAmbisonicY = 40,
  78. SoundIoChannelIdAmbisonicZ = 41,
  79. SoundIoChannelIdXyX = 42,
  80. SoundIoChannelIdXyY = 43,
  81. SoundIoChannelIdHeadphonesLeft = 44,
  82. SoundIoChannelIdHeadphonesRight = 45,
  83. SoundIoChannelIdClickTrack = 46,
  84. SoundIoChannelIdForeignLanguage = 47,
  85. SoundIoChannelIdHearingImpaired = 48,
  86. SoundIoChannelIdNarration = 49,
  87. SoundIoChannelIdHaptic = 50,
  88. SoundIoChannelIdDialogCentricMix = 51,
  89. SoundIoChannelIdAux = 52,
  90. SoundIoChannelIdAux0 = 53,
  91. SoundIoChannelIdAux1 = 54,
  92. SoundIoChannelIdAux2 = 55,
  93. SoundIoChannelIdAux3 = 56,
  94. SoundIoChannelIdAux4 = 57,
  95. SoundIoChannelIdAux5 = 58,
  96. SoundIoChannelIdAux6 = 59,
  97. SoundIoChannelIdAux7 = 60,
  98. SoundIoChannelIdAux8 = 61,
  99. SoundIoChannelIdAux9 = 62,
  100. SoundIoChannelIdAux10 = 63,
  101. SoundIoChannelIdAux11 = 64,
  102. SoundIoChannelIdAux12 = 65,
  103. SoundIoChannelIdAux13 = 66,
  104. SoundIoChannelIdAux14 = 67,
  105. SoundIoChannelIdAux15 = 68,
  106. }
  107. enum SoundIoChannelLayoutId // soundio.h (189, 6)
  108. {
  109. SoundIoChannelLayoutIdMono = 0,
  110. SoundIoChannelLayoutIdStereo = 1,
  111. SoundIoChannelLayoutId2Point1 = 2,
  112. SoundIoChannelLayoutId3Point0 = 3,
  113. SoundIoChannelLayoutId3Point0Back = 4,
  114. SoundIoChannelLayoutId3Point1 = 5,
  115. SoundIoChannelLayoutId4Point0 = 6,
  116. SoundIoChannelLayoutIdQuad = 7,
  117. SoundIoChannelLayoutIdQuadSide = 8,
  118. SoundIoChannelLayoutId4Point1 = 9,
  119. SoundIoChannelLayoutId5Point0Back = 10,
  120. SoundIoChannelLayoutId5Point0Side = 11,
  121. SoundIoChannelLayoutId5Point1 = 12,
  122. SoundIoChannelLayoutId5Point1Back = 13,
  123. SoundIoChannelLayoutId6Point0Side = 14,
  124. SoundIoChannelLayoutId6Point0Front = 15,
  125. SoundIoChannelLayoutIdHexagonal = 16,
  126. SoundIoChannelLayoutId6Point1 = 17,
  127. SoundIoChannelLayoutId6Point1Back = 18,
  128. SoundIoChannelLayoutId6Point1Front = 19,
  129. SoundIoChannelLayoutId7Point0 = 20,
  130. SoundIoChannelLayoutId7Point0Front = 21,
  131. SoundIoChannelLayoutId7Point1 = 22,
  132. SoundIoChannelLayoutId7Point1Wide = 23,
  133. SoundIoChannelLayoutId7Point1WideBack = 24,
  134. SoundIoChannelLayoutIdOctagonal = 25,
  135. }
  136. enum SoundIoBackend // soundio.h (218, 6)
  137. {
  138. SoundIoBackendNone = 0,
  139. SoundIoBackendJack = 1,
  140. SoundIoBackendPulseAudio = 2,
  141. SoundIoBackendAlsa = 3,
  142. SoundIoBackendCoreAudio = 4,
  143. SoundIoBackendWasapi = 5,
  144. SoundIoBackendDummy = 6,
  145. }
  146. enum SoundIoDeviceAim // soundio.h (228, 6)
  147. {
  148. SoundIoDeviceAimInput = 0,
  149. SoundIoDeviceAimOutput = 1,
  150. }
  151. enum SoundIoFormat // soundio.h (235, 6)
  152. {
  153. SoundIoFormatInvalid = 0,
  154. SoundIoFormatS8 = 1,
  155. SoundIoFormatU8 = 2,
  156. SoundIoFormatS16LE = 3,
  157. SoundIoFormatS16BE = 4,
  158. SoundIoFormatU16LE = 5,
  159. SoundIoFormatU16BE = 6,
  160. SoundIoFormatS24LE = 7,
  161. SoundIoFormatS24BE = 8,
  162. SoundIoFormatU24LE = 9,
  163. SoundIoFormatU24BE = 10,
  164. SoundIoFormatS32LE = 11,
  165. SoundIoFormatS32BE = 12,
  166. SoundIoFormatU32LE = 13,
  167. SoundIoFormatU32BE = 14,
  168. SoundIoFormatFloat32LE = 15,
  169. SoundIoFormatFloat32BE = 16,
  170. SoundIoFormatFloat64LE = 17,
  171. SoundIoFormatFloat64BE = 18,
  172. }
  173. [StructLayout(LayoutKind.Sequential)]
  174. struct SoundIoChannelLayout // soundio.h (302, 8)
  175. {
  176. [CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
  177. public int @channel_count;
  178. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
  179. [CTypeDetails("ConstArrayOf<SoundIoChannelId>")] public SoundIoChannelId[] @channels;
  180. }
  181. [StructLayout(LayoutKind.Sequential)]
  182. struct SoundIoSampleRateRange // soundio.h (309, 8)
  183. {
  184. public int @min;
  185. public int @max;
  186. }
  187. [StructLayout(LayoutKind.Sequential)]
  188. struct SoundIoChannelArea // soundio.h (315, 8)
  189. {
  190. [CTypeDetails("Pointer<byte>")] public System.IntPtr @ptr;
  191. public int @step;
  192. }
  193. [StructLayout(LayoutKind.Sequential)]
  194. struct SoundIo // soundio.h (324, 8)
  195. {
  196. [CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
  197. [CTypeDetails("Pointer<void (SoundIo *)>")] public delegate0 @on_devices_change;
  198. [CTypeDetails("Pointer<void (SoundIo *, int)>")] public delegate1 @on_backend_disconnect;
  199. [CTypeDetails("Pointer<void (SoundIo *)>")] public Delegates.delegate0 @on_events_signal;
  200. public SoundIoBackend @current_backend;
  201. [CTypeDetails("Pointer<byte>")] public System.IntPtr @app_name;
  202. [CTypeDetails("Pointer<void ()>")] public delegate2 @emit_rtprio_warning;
  203. [CTypeDetails("Pointer<void (const char *)>")] public delegate3 @jack_info_callback;
  204. [CTypeDetails("Pointer<void (const char *)>")] public Delegates.delegate3 @jack_error_callback;
  205. }
  206. [StructLayout(LayoutKind.Sequential)]
  207. struct SoundIoDevice // soundio.h (383, 8)
  208. {
  209. [CTypeDetails("Pointer<SoundIo>")] public System.IntPtr @soundio;
  210. [CTypeDetails("Pointer<byte>")] public System.IntPtr @id;
  211. [CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
  212. public SoundIoDeviceAim @aim;
  213. [CTypeDetails("Pointer<SoundIoChannelLayout>")] public System.IntPtr @layouts;
  214. public int @layout_count;
  215. public SoundIoChannelLayout @current_layout;
  216. [CTypeDetails("Pointer<SoundIoFormat>")] public System.IntPtr @formats;
  217. public int @format_count;
  218. public SoundIoFormat @current_format;
  219. [CTypeDetails("Pointer<SoundIoSampleRateRange>")] public System.IntPtr @sample_rates;
  220. public int @sample_rate_count;
  221. public int @sample_rate_current;
  222. public double @software_latency_min;
  223. public double @software_latency_max;
  224. public double @software_latency_current;
  225. public bool @is_raw;
  226. public int @ref_count;
  227. public int @probe_error;
  228. }
  229. [StructLayout(LayoutKind.Sequential)]
  230. struct SoundIoOutStream // soundio.h (493, 8)
  231. {
  232. [CTypeDetails("Pointer<SoundIoDevice>")] public System.IntPtr @device;
  233. public SoundIoFormat @format;
  234. public int @sample_rate;
  235. public SoundIoChannelLayout @layout;
  236. public double @software_latency;
  237. [CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
  238. [CTypeDetails("Pointer<void (SoundIoOutStream *, int, int)>")] public delegate4 @write_callback;
  239. [CTypeDetails("Pointer<void (SoundIoOutStream *)>")] public delegate5 @underflow_callback;
  240. [CTypeDetails("Pointer<void (SoundIoOutStream *, int)>")] public delegate6 @error_callback;
  241. [CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
  242. public bool @non_terminal_hint;
  243. public int @bytes_per_frame;
  244. public int @bytes_per_sample;
  245. public int @layout_error;
  246. }
  247. [StructLayout(LayoutKind.Sequential)]
  248. struct SoundIoInStream // soundio.h (595, 8)
  249. {
  250. [CTypeDetails("Pointer<SoundIoDevice>")] public System.IntPtr @device;
  251. public SoundIoFormat @format;
  252. public int @sample_rate;
  253. public SoundIoChannelLayout @layout;
  254. public double @software_latency;
  255. [CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
  256. [CTypeDetails("Pointer<void (SoundIoInStream *, int, int)>")] public delegate7 @read_callback;
  257. [CTypeDetails("Pointer<void (SoundIoInStream *)>")] public delegate8 @overflow_callback;
  258. [CTypeDetails("Pointer<void (SoundIoInStream *, int)>")] public delegate9 @error_callback;
  259. [CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
  260. public bool @non_terminal_hint;
  261. public int @bytes_per_frame;
  262. public int @bytes_per_sample;
  263. public int @layout_error;
  264. }
  265. [StructLayout(LayoutKind.Sequential)]
  266. struct SoundIoRingBuffer // soundio.h (1167, 8)
  267. {
  268. }
  269. partial class Natives
  270. {
  271. const string LibraryName = "libsoundio";
  272. // function soundio_version_string - soundio.h (677, 28)
  273. [DllImport(LibraryName)]
  274. internal static extern System.IntPtr soundio_version_string();
  275. // function soundio_version_major - soundio.h (679, 20)
  276. [DllImport(LibraryName)]
  277. internal static extern int soundio_version_major();
  278. // function soundio_version_minor - soundio.h (681, 20)
  279. [DllImport(LibraryName)]
  280. internal static extern int soundio_version_minor();
  281. // function soundio_version_patch - soundio.h (683, 20)
  282. [DllImport(LibraryName)]
  283. internal static extern int soundio_version_patch();
  284. // function soundio_create - soundio.h (689, 32)
  285. [DllImport(LibraryName)]
  286. internal static extern System.IntPtr soundio_create();
  287. // function soundio_destroy - soundio.h (690, 21)
  288. [DllImport(LibraryName)]
  289. internal static extern void soundio_destroy([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  290. // function soundio_connect - soundio.h (700, 20)
  291. [DllImport(LibraryName)]
  292. internal static extern int soundio_connect([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  293. // function soundio_connect_backend - soundio.h (712, 20)
  294. [DllImport(LibraryName)]
  295. internal static extern int soundio_connect_backend([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, SoundIoBackend @backend);
  296. // function soundio_disconnect - soundio.h (713, 21)
  297. [DllImport(LibraryName)]
  298. internal static extern void soundio_disconnect([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  299. // function soundio_strerror - soundio.h (716, 28)
  300. [DllImport(LibraryName)]
  301. internal static extern System.IntPtr soundio_strerror(int @error);
  302. // function soundio_backend_name - soundio.h (718, 28)
  303. [DllImport(LibraryName)]
  304. internal static extern System.IntPtr soundio_backend_name(SoundIoBackend @backend);
  305. // function soundio_backend_count - soundio.h (721, 20)
  306. [DllImport(LibraryName)]
  307. internal static extern int soundio_backend_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  308. // function soundio_get_backend - soundio.h (724, 36)
  309. [DllImport(LibraryName)]
  310. internal static extern SoundIoBackend soundio_get_backend([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
  311. // function soundio_have_backend - soundio.h (727, 21)
  312. [DllImport(LibraryName)]
  313. internal static extern bool soundio_have_backend(SoundIoBackend @backend);
  314. // function soundio_flush_events - soundio.h (751, 21)
  315. [DllImport(LibraryName)]
  316. internal static extern void soundio_flush_events([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  317. // function soundio_wait_events - soundio.h (755, 21)
  318. [DllImport(LibraryName)]
  319. internal static extern void soundio_wait_events([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  320. // function soundio_wakeup - soundio.h (758, 21)
  321. [DllImport(LibraryName)]
  322. internal static extern void soundio_wakeup([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  323. // function soundio_force_device_scan - soundio.h (775, 21)
  324. [DllImport(LibraryName)]
  325. internal static extern void soundio_force_device_scan([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  326. // function soundio_channel_layout_equal - soundio.h (782, 21)
  327. [DllImport(LibraryName)]
  328. internal static extern bool soundio_channel_layout_equal([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @a, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @b);
  329. // function soundio_get_channel_name - soundio.h (786, 28)
  330. [DllImport(LibraryName)]
  331. internal static extern System.IntPtr soundio_get_channel_name(SoundIoChannelId @id);
  332. // function soundio_parse_channel_id - soundio.h (790, 38)
  333. [DllImport(LibraryName)]
  334. internal static extern SoundIoChannelId soundio_parse_channel_id([CTypeDetails("Pointer<byte>")]System.IntPtr @str, int @str_len);
  335. // function soundio_channel_layout_builtin_count - soundio.h (793, 20)
  336. [DllImport(LibraryName)]
  337. internal static extern int soundio_channel_layout_builtin_count();
  338. // function soundio_channel_layout_get_builtin - soundio.h (798, 51)
  339. [DllImport(LibraryName)]
  340. internal static extern System.IntPtr soundio_channel_layout_get_builtin(int @index);
  341. // function soundio_channel_layout_get_default - soundio.h (801, 51)
  342. [DllImport(LibraryName)]
  343. internal static extern System.IntPtr soundio_channel_layout_get_default(int @channel_count);
  344. // function soundio_channel_layout_find_channel - soundio.h (804, 20)
  345. [DllImport(LibraryName)]
  346. internal static extern int soundio_channel_layout_find_channel([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout, SoundIoChannelId @channel);
  347. // function soundio_channel_layout_detect_builtin - soundio.h (809, 21)
  348. [DllImport(LibraryName)]
  349. internal static extern bool soundio_channel_layout_detect_builtin([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout);
  350. // function soundio_best_matching_channel_layout - soundio.h (814, 51)
  351. [DllImport(LibraryName)]
  352. internal static extern System.IntPtr soundio_best_matching_channel_layout([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @preferred_layouts, int @preferred_layout_count, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @available_layouts, int @available_layout_count);
  353. // function soundio_sort_channel_layouts - soundio.h (819, 21)
  354. [DllImport(LibraryName)]
  355. internal static extern void soundio_sort_channel_layouts([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layouts, int @layout_count);
  356. // function soundio_get_bytes_per_sample - soundio.h (825, 20)
  357. [DllImport(LibraryName)]
  358. internal static extern int soundio_get_bytes_per_sample(SoundIoFormat @format);
  359. // function soundio_get_bytes_per_frame - soundio.h (828, 19)
  360. [DllImport(LibraryName)]
  361. internal static extern int soundio_get_bytes_per_frame(SoundIoFormat @format, int @channel_count);
  362. // function soundio_get_bytes_per_second - soundio.h (833, 19)
  363. [DllImport(LibraryName)]
  364. internal static extern int soundio_get_bytes_per_second(SoundIoFormat @format, int @channel_count, int @sample_rate);
  365. // function soundio_format_string - soundio.h (840, 29)
  366. [DllImport(LibraryName)]
  367. internal static extern System.IntPtr soundio_format_string(SoundIoFormat @format);
  368. // function soundio_input_device_count - soundio.h (856, 20)
  369. [DllImport(LibraryName)]
  370. internal static extern int soundio_input_device_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  371. // function soundio_output_device_count - soundio.h (859, 20)
  372. [DllImport(LibraryName)]
  373. internal static extern int soundio_output_device_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  374. // function soundio_get_input_device - soundio.h (865, 38)
  375. [DllImport(LibraryName)]
  376. internal static extern System.IntPtr soundio_get_input_device([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
  377. // function soundio_get_output_device - soundio.h (870, 38)
  378. [DllImport(LibraryName)]
  379. internal static extern System.IntPtr soundio_get_output_device([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
  380. // function soundio_default_input_device_index - soundio.h (875, 20)
  381. [DllImport(LibraryName)]
  382. internal static extern int soundio_default_input_device_index([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  383. // function soundio_default_output_device_index - soundio.h (880, 20)
  384. [DllImport(LibraryName)]
  385. internal static extern int soundio_default_output_device_index([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  386. // function soundio_device_ref - soundio.h (883, 21)
  387. [DllImport(LibraryName)]
  388. internal static extern void soundio_device_ref([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  389. // function soundio_device_unref - soundio.h (886, 21)
  390. [DllImport(LibraryName)]
  391. internal static extern void soundio_device_unref([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  392. // function soundio_device_equal - soundio.h (890, 21)
  393. [DllImport(LibraryName)]
  394. internal static extern bool soundio_device_equal([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @a, [CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @b);
  395. // function soundio_device_sort_channel_layouts - soundio.h (895, 21)
  396. [DllImport(LibraryName)]
  397. internal static extern void soundio_device_sort_channel_layouts([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  398. // function soundio_device_supports_format - soundio.h (899, 21)
  399. [DllImport(LibraryName)]
  400. internal static extern bool soundio_device_supports_format([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, SoundIoFormat @format);
  401. // function soundio_device_supports_layout - soundio.h (904, 21)
  402. [DllImport(LibraryName)]
  403. internal static extern bool soundio_device_supports_layout([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout);
  404. // function soundio_device_supports_sample_rate - soundio.h (909, 21)
  405. [DllImport(LibraryName)]
  406. internal static extern bool soundio_device_supports_sample_rate([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, int @sample_rate);
  407. // function soundio_device_nearest_sample_rate - soundio.h (914, 20)
  408. [DllImport(LibraryName)]
  409. internal static extern int soundio_device_nearest_sample_rate([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, int @sample_rate);
  410. // function soundio_outstream_create - soundio.h (924, 41)
  411. [DllImport(LibraryName)]
  412. internal static extern System.IntPtr soundio_outstream_create([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  413. // function soundio_outstream_destroy - soundio.h (926, 21)
  414. [DllImport(LibraryName)]
  415. internal static extern void soundio_outstream_destroy([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  416. // function soundio_outstream_open - soundio.h (950, 20)
  417. [DllImport(LibraryName)]
  418. internal static extern int soundio_outstream_open([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  419. // function soundio_outstream_start - soundio.h (961, 20)
  420. [DllImport(LibraryName)]
  421. internal static extern int soundio_outstream_start([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  422. // function soundio_outstream_begin_write - soundio.h (993, 20)
  423. [DllImport(LibraryName)]
  424. internal static extern int soundio_outstream_begin_write([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, [CTypeDetails("Pointer<System.IntPtr>")]System.IntPtr @areas, [CTypeDetails("Pointer<int>")]System.IntPtr @frame_count);
  425. // function soundio_outstream_end_write - soundio.h (1005, 20)
  426. [DllImport(LibraryName)]
  427. internal static extern int soundio_outstream_end_write([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  428. // function soundio_outstream_clear_buffer - soundio.h (1020, 20)
  429. [DllImport(LibraryName)]
  430. internal static extern int soundio_outstream_clear_buffer([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  431. // function soundio_outstream_pause - soundio.h (1041, 20)
  432. [DllImport(LibraryName)]
  433. internal static extern int soundio_outstream_pause([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, bool @pause);
  434. // function soundio_outstream_get_latency - soundio.h (1054, 20)
  435. [DllImport(LibraryName)]
  436. internal static extern int soundio_outstream_get_latency([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, [CTypeDetails("Pointer<double>")]System.IntPtr @out_latency);
  437. // function soundio_instream_create - soundio.h (1064, 40)
  438. [DllImport(LibraryName)]
  439. internal static extern System.IntPtr soundio_instream_create([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  440. // function soundio_instream_destroy - soundio.h (1066, 21)
  441. [DllImport(LibraryName)]
  442. internal static extern void soundio_instream_destroy([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  443. // function soundio_instream_open - soundio.h (1086, 20)
  444. [DllImport(LibraryName)]
  445. internal static extern int soundio_instream_open([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  446. // function soundio_instream_start - soundio.h (1095, 20)
  447. [DllImport(LibraryName)]
  448. internal static extern int soundio_instream_start([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  449. // function soundio_instream_begin_read - soundio.h (1126, 20)
  450. [DllImport(LibraryName)]
  451. internal static extern int soundio_instream_begin_read([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, [CTypeDetails("Pointer<System.IntPtr>")]System.IntPtr @areas, [CTypeDetails("Pointer<int>")]System.IntPtr @frame_count);
  452. // function soundio_instream_end_read - soundio.h (1136, 20)
  453. [DllImport(LibraryName)]
  454. internal static extern int soundio_instream_end_read([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  455. // function soundio_instream_pause - soundio.h (1149, 20)
  456. [DllImport(LibraryName)]
  457. internal static extern int soundio_instream_pause([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, bool @pause);
  458. // function soundio_instream_get_latency - soundio.h (1159, 20)
  459. [DllImport(LibraryName)]
  460. internal static extern int soundio_instream_get_latency([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, [CTypeDetails("Pointer<double>")]System.IntPtr @out_latency);
  461. // function soundio_ring_buffer_create - soundio.h (1173, 42)
  462. [DllImport(LibraryName)]
  463. internal static extern System.IntPtr soundio_ring_buffer_create([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @requested_capacity);
  464. // function soundio_ring_buffer_destroy - soundio.h (1174, 21)
  465. [DllImport(LibraryName)]
  466. internal static extern void soundio_ring_buffer_destroy([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  467. // function soundio_ring_buffer_capacity - soundio.h (1178, 20)
  468. [DllImport(LibraryName)]
  469. internal static extern int soundio_ring_buffer_capacity([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  470. // function soundio_ring_buffer_write_ptr - soundio.h (1181, 22)
  471. [DllImport(LibraryName)]
  472. internal static extern System.IntPtr soundio_ring_buffer_write_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  473. // function soundio_ring_buffer_advance_write_ptr - soundio.h (1183, 21)
  474. [DllImport(LibraryName)]
  475. internal static extern void soundio_ring_buffer_advance_write_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer, int @count);
  476. // function soundio_ring_buffer_read_ptr - soundio.h (1186, 22)
  477. [DllImport(LibraryName)]
  478. internal static extern System.IntPtr soundio_ring_buffer_read_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  479. // function soundio_ring_buffer_advance_read_ptr - soundio.h (1188, 21)
  480. [DllImport(LibraryName)]
  481. internal static extern void soundio_ring_buffer_advance_read_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer, int @count);
  482. // function soundio_ring_buffer_fill_count - soundio.h (1191, 20)
  483. [DllImport(LibraryName)]
  484. internal static extern int soundio_ring_buffer_fill_count([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  485. // function soundio_ring_buffer_free_count - soundio.h (1194, 20)
  486. [DllImport(LibraryName)]
  487. internal static extern int soundio_ring_buffer_free_count([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  488. // function soundio_ring_buffer_clear - soundio.h (1197, 21)
  489. [DllImport(LibraryName)]
  490. internal static extern void soundio_ring_buffer_clear([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  491. }
  492. class Delegates
  493. {
  494. public delegate void delegate0(System.IntPtr p0);
  495. public delegate void delegate1(System.IntPtr p0, int p1);
  496. public delegate void delegate2();
  497. public delegate void delegate3(System.IntPtr p0);
  498. public delegate void delegate4(System.IntPtr p0, int p1, int p2);
  499. public delegate void delegate5(System.IntPtr p0);
  500. public delegate void delegate6(System.IntPtr p0, int p1);
  501. public delegate void delegate7(System.IntPtr p0, int p1, int p2);
  502. public delegate void delegate8(System.IntPtr p0);
  503. public delegate void delegate9(System.IntPtr p0, int p1);
  504. }
  505. public struct Pointer<T>
  506. {
  507. public IntPtr Handle;
  508. public static implicit operator IntPtr(Pointer<T> value) { return value.Handle; }
  509. public static implicit operator Pointer<T>(IntPtr value) { return new Pointer<T>(value); }
  510. public Pointer(IntPtr handle)
  511. {
  512. Handle = handle;
  513. }
  514. public override bool Equals(object obj)
  515. {
  516. return obj is Pointer<T> && this == (Pointer<T>)obj;
  517. }
  518. public override int GetHashCode()
  519. {
  520. return (int)Handle;
  521. }
  522. public static bool operator ==(Pointer<T> p1, Pointer<T> p2)
  523. {
  524. return p1.Handle == p2.Handle;
  525. }
  526. public static bool operator !=(Pointer<T> p1, Pointer<T> p2)
  527. {
  528. return p1.Handle != p2.Handle;
  529. }
  530. }
  531. public struct ArrayOf<T> { }
  532. public struct ConstArrayOf<T> { }
  533. public class CTypeDetailsAttribute : Attribute
  534. {
  535. public CTypeDetailsAttribute(string value)
  536. {
  537. Value = value;
  538. }
  539. public string Value { get; set; }
  540. }
  541. }