libsoundio-interop.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  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 (306, 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 (313, 8)
  183. {
  184. public int @min;
  185. public int @max;
  186. }
  187. [StructLayout(LayoutKind.Sequential)]
  188. struct SoundIoChannelArea // soundio.h (319, 8)
  189. {
  190. [CTypeDetails("Pointer<byte>")] public System.IntPtr @ptr;
  191. public int @step;
  192. }
  193. [StructLayout(LayoutKind.Sequential)]
  194. struct SoundIo // soundio.h (328, 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 (387, 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 (497, 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. public float @volume;
  238. [CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
  239. [CTypeDetails("Pointer<void (SoundIoOutStream *, int, int)>")] public delegate4 @write_callback;
  240. [CTypeDetails("Pointer<void (SoundIoOutStream *)>")] public delegate5 @underflow_callback;
  241. [CTypeDetails("Pointer<void (SoundIoOutStream *, int)>")] public delegate6 @error_callback;
  242. [CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
  243. public bool @non_terminal_hint;
  244. public int @bytes_per_frame;
  245. public int @bytes_per_sample;
  246. public int @layout_error;
  247. }
  248. [StructLayout(LayoutKind.Sequential)]
  249. struct SoundIoInStream // soundio.h (600, 8)
  250. {
  251. [CTypeDetails("Pointer<SoundIoDevice>")] public System.IntPtr @device;
  252. public SoundIoFormat @format;
  253. public int @sample_rate;
  254. public SoundIoChannelLayout @layout;
  255. public double @software_latency;
  256. [CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
  257. [CTypeDetails("Pointer<void (SoundIoInStream *, int, int)>")] public delegate7 @read_callback;
  258. [CTypeDetails("Pointer<void (SoundIoInStream *)>")] public delegate8 @overflow_callback;
  259. [CTypeDetails("Pointer<void (SoundIoInStream *, int)>")] public delegate9 @error_callback;
  260. [CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
  261. public bool @non_terminal_hint;
  262. public int @bytes_per_frame;
  263. public int @bytes_per_sample;
  264. public int @layout_error;
  265. }
  266. [StructLayout(LayoutKind.Sequential)]
  267. struct SoundIoRingBuffer // soundio.h (1170, 8)
  268. {
  269. }
  270. partial class Natives
  271. {
  272. const string LibraryName = "libsoundio";
  273. // function soundio_version_string - soundio.h (682, 28)
  274. [DllImport(LibraryName)]
  275. internal static extern System.IntPtr soundio_version_string();
  276. // function soundio_version_major - soundio.h (684, 20)
  277. [DllImport(LibraryName)]
  278. internal static extern int soundio_version_major();
  279. // function soundio_version_minor - soundio.h (686, 20)
  280. [DllImport(LibraryName)]
  281. internal static extern int soundio_version_minor();
  282. // function soundio_version_patch - soundio.h (688, 20)
  283. [DllImport(LibraryName)]
  284. internal static extern int soundio_version_patch();
  285. // function soundio_create - soundio.h (694, 32)
  286. [DllImport(LibraryName)]
  287. internal static extern System.IntPtr soundio_create();
  288. // function soundio_destroy - soundio.h (695, 21)
  289. [DllImport(LibraryName)]
  290. internal static extern void soundio_destroy([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  291. // function soundio_connect - soundio.h (705, 20)
  292. [DllImport(LibraryName)]
  293. internal static extern int soundio_connect([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  294. // function soundio_connect_backend - soundio.h (717, 20)
  295. [DllImport(LibraryName)]
  296. internal static extern int soundio_connect_backend([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, SoundIoBackend @backend);
  297. // function soundio_disconnect - soundio.h (718, 21)
  298. [DllImport(LibraryName)]
  299. internal static extern void soundio_disconnect([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  300. // function soundio_strerror - soundio.h (721, 28)
  301. [DllImport(LibraryName)]
  302. internal static extern System.IntPtr soundio_strerror(int @error);
  303. // function soundio_backend_name - soundio.h (723, 28)
  304. [DllImport(LibraryName)]
  305. internal static extern System.IntPtr soundio_backend_name(SoundIoBackend @backend);
  306. // function soundio_backend_count - soundio.h (726, 20)
  307. [DllImport(LibraryName)]
  308. internal static extern int soundio_backend_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  309. // function soundio_get_backend - soundio.h (729, 36)
  310. [DllImport(LibraryName)]
  311. internal static extern SoundIoBackend soundio_get_backend([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
  312. // function soundio_have_backend - soundio.h (732, 21)
  313. [DllImport(LibraryName)]
  314. internal static extern bool soundio_have_backend(SoundIoBackend @backend);
  315. // function soundio_flush_events - soundio.h (756, 21)
  316. [DllImport(LibraryName)]
  317. internal static extern void soundio_flush_events([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  318. // function soundio_wait_events - soundio.h (760, 21)
  319. [DllImport(LibraryName)]
  320. internal static extern void soundio_wait_events([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  321. // function soundio_wakeup - soundio.h (763, 21)
  322. [DllImport(LibraryName)]
  323. internal static extern void soundio_wakeup([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  324. // function soundio_force_device_scan - soundio.h (780, 21)
  325. [DllImport(LibraryName)]
  326. internal static extern void soundio_force_device_scan([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  327. // function soundio_channel_layout_equal - soundio.h (787, 21)
  328. [DllImport(LibraryName)]
  329. internal static extern bool soundio_channel_layout_equal([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @a, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @b);
  330. // function soundio_get_channel_name - soundio.h (791, 28)
  331. [DllImport(LibraryName)]
  332. internal static extern System.IntPtr soundio_get_channel_name(SoundIoChannelId @id);
  333. // function soundio_parse_channel_id - soundio.h (795, 38)
  334. [DllImport(LibraryName)]
  335. internal static extern SoundIoChannelId soundio_parse_channel_id([CTypeDetails("Pointer<byte>")]System.IntPtr @str, int @str_len);
  336. // function soundio_channel_layout_builtin_count - soundio.h (798, 20)
  337. [DllImport(LibraryName)]
  338. internal static extern int soundio_channel_layout_builtin_count();
  339. // function soundio_channel_layout_get_builtin - soundio.h (803, 51)
  340. [DllImport(LibraryName)]
  341. internal static extern System.IntPtr soundio_channel_layout_get_builtin(int @index);
  342. // function soundio_channel_layout_get_default - soundio.h (806, 51)
  343. [DllImport(LibraryName)]
  344. internal static extern System.IntPtr soundio_channel_layout_get_default(int @channel_count);
  345. // function soundio_channel_layout_find_channel - soundio.h (809, 20)
  346. [DllImport(LibraryName)]
  347. internal static extern int soundio_channel_layout_find_channel([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout, SoundIoChannelId @channel);
  348. // function soundio_channel_layout_detect_builtin - soundio.h (814, 21)
  349. [DllImport(LibraryName)]
  350. internal static extern bool soundio_channel_layout_detect_builtin([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout);
  351. // function soundio_best_matching_channel_layout - soundio.h (819, 51)
  352. [DllImport(LibraryName)]
  353. 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);
  354. // function soundio_sort_channel_layouts - soundio.h (824, 21)
  355. [DllImport(LibraryName)]
  356. internal static extern void soundio_sort_channel_layouts([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layouts, int @layout_count);
  357. // function soundio_get_bytes_per_sample - soundio.h (830, 20)
  358. [DllImport(LibraryName)]
  359. internal static extern int soundio_get_bytes_per_sample(SoundIoFormat @format);
  360. // function soundio_get_bytes_per_frame - soundio.h (833, 19)
  361. [DllImport(LibraryName)]
  362. internal static extern int soundio_get_bytes_per_frame(SoundIoFormat @format, int @channel_count);
  363. // function soundio_get_bytes_per_second - soundio.h (838, 19)
  364. [DllImport(LibraryName)]
  365. internal static extern int soundio_get_bytes_per_second(SoundIoFormat @format, int @channel_count, int @sample_rate);
  366. // function soundio_format_string - soundio.h (845, 29)
  367. [DllImport(LibraryName)]
  368. internal static extern System.IntPtr soundio_format_string(SoundIoFormat @format);
  369. // function soundio_input_device_count - soundio.h (861, 20)
  370. [DllImport(LibraryName)]
  371. internal static extern int soundio_input_device_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  372. // function soundio_output_device_count - soundio.h (864, 20)
  373. [DllImport(LibraryName)]
  374. internal static extern int soundio_output_device_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  375. // function soundio_get_input_device - soundio.h (870, 38)
  376. [DllImport(LibraryName)]
  377. internal static extern System.IntPtr soundio_get_input_device([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
  378. // function soundio_get_output_device - soundio.h (875, 38)
  379. [DllImport(LibraryName)]
  380. internal static extern System.IntPtr soundio_get_output_device([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
  381. // function soundio_default_input_device_index - soundio.h (880, 20)
  382. [DllImport(LibraryName)]
  383. internal static extern int soundio_default_input_device_index([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  384. // function soundio_default_output_device_index - soundio.h (885, 20)
  385. [DllImport(LibraryName)]
  386. internal static extern int soundio_default_output_device_index([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
  387. // function soundio_device_ref - soundio.h (888, 21)
  388. [DllImport(LibraryName)]
  389. internal static extern void soundio_device_ref([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  390. // function soundio_device_unref - soundio.h (891, 21)
  391. [DllImport(LibraryName)]
  392. internal static extern void soundio_device_unref([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  393. // function soundio_device_equal - soundio.h (895, 21)
  394. [DllImport(LibraryName)]
  395. internal static extern bool soundio_device_equal([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @a, [CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @b);
  396. // function soundio_device_sort_channel_layouts - soundio.h (900, 21)
  397. [DllImport(LibraryName)]
  398. internal static extern void soundio_device_sort_channel_layouts([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  399. // function soundio_device_supports_format - soundio.h (904, 21)
  400. [DllImport(LibraryName)]
  401. internal static extern bool soundio_device_supports_format([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, SoundIoFormat @format);
  402. // function soundio_device_supports_layout - soundio.h (909, 21)
  403. [DllImport(LibraryName)]
  404. internal static extern bool soundio_device_supports_layout([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout);
  405. // function soundio_device_supports_sample_rate - soundio.h (914, 21)
  406. [DllImport(LibraryName)]
  407. internal static extern bool soundio_device_supports_sample_rate([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, int @sample_rate);
  408. // function soundio_device_nearest_sample_rate - soundio.h (919, 20)
  409. [DllImport(LibraryName)]
  410. internal static extern int soundio_device_nearest_sample_rate([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, int @sample_rate);
  411. // function soundio_outstream_create - soundio.h (929, 41)
  412. [DllImport(LibraryName)]
  413. internal static extern System.IntPtr soundio_outstream_create([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  414. // function soundio_outstream_destroy - soundio.h (931, 21)
  415. [DllImport(LibraryName)]
  416. internal static extern void soundio_outstream_destroy([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  417. // function soundio_outstream_open - soundio.h (954, 20)
  418. [DllImport(LibraryName)]
  419. internal static extern int soundio_outstream_open([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  420. // function soundio_outstream_start - soundio.h (965, 20)
  421. [DllImport(LibraryName)]
  422. internal static extern int soundio_outstream_start([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  423. // function soundio_outstream_begin_write - soundio.h (997, 20)
  424. [DllImport(LibraryName)]
  425. 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);
  426. // function soundio_outstream_end_write - soundio.h (1009, 20)
  427. [DllImport(LibraryName)]
  428. internal static extern int soundio_outstream_end_write([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  429. // function soundio_outstream_clear_buffer - soundio.h (1024, 20)
  430. [DllImport(LibraryName)]
  431. internal static extern int soundio_outstream_clear_buffer([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
  432. // function soundio_outstream_pause - soundio.h (1045, 20)
  433. [DllImport(LibraryName)]
  434. internal static extern int soundio_outstream_pause([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, bool @pause);
  435. // function soundio_outstream_get_latency - soundio.h (1058, 20)
  436. [DllImport(LibraryName)]
  437. internal static extern int soundio_outstream_get_latency([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, [CTypeDetails("Pointer<double>")]System.IntPtr @out_latency);
  438. // function soundio_outstream_set_volume - soundio.h (1061, 20)
  439. [DllImport(LibraryName)]
  440. internal static extern int soundio_outstream_set_volume([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, double @volume);
  441. // function soundio_instream_create - soundio.h (1071, 40)
  442. [DllImport(LibraryName)]
  443. internal static extern System.IntPtr soundio_instream_create([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
  444. // function soundio_instream_destroy - soundio.h (1073, 21)
  445. [DllImport(LibraryName)]
  446. internal static extern void soundio_instream_destroy([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  447. // function soundio_instream_open - soundio.h (1093, 20)
  448. [DllImport(LibraryName)]
  449. internal static extern int soundio_instream_open([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  450. // function soundio_instream_start - soundio.h (1102, 20)
  451. [DllImport(LibraryName)]
  452. internal static extern int soundio_instream_start([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  453. // function soundio_instream_begin_read - soundio.h (1133, 20)
  454. [DllImport(LibraryName)]
  455. 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);
  456. // function soundio_instream_end_read - soundio.h (1143, 20)
  457. [DllImport(LibraryName)]
  458. internal static extern int soundio_instream_end_read([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
  459. // function soundio_instream_pause - soundio.h (1156, 20)
  460. [DllImport(LibraryName)]
  461. internal static extern int soundio_instream_pause([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, bool @pause);
  462. // function soundio_instream_get_latency - soundio.h (1166, 20)
  463. [DllImport(LibraryName)]
  464. internal static extern int soundio_instream_get_latency([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, [CTypeDetails("Pointer<double>")]System.IntPtr @out_latency);
  465. // function soundio_ring_buffer_create - soundio.h (1181, 42)
  466. [DllImport(LibraryName)]
  467. internal static extern System.IntPtr soundio_ring_buffer_create([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @requested_capacity);
  468. // function soundio_ring_buffer_destroy - soundio.h (1182, 21)
  469. [DllImport(LibraryName)]
  470. internal static extern void soundio_ring_buffer_destroy([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  471. // function soundio_ring_buffer_capacity - soundio.h (1186, 20)
  472. [DllImport(LibraryName)]
  473. internal static extern int soundio_ring_buffer_capacity([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  474. // function soundio_ring_buffer_write_ptr - soundio.h (1189, 22)
  475. [DllImport(LibraryName)]
  476. internal static extern System.IntPtr soundio_ring_buffer_write_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  477. // function soundio_ring_buffer_advance_write_ptr - soundio.h (1191, 21)
  478. [DllImport(LibraryName)]
  479. internal static extern void soundio_ring_buffer_advance_write_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer, int @count);
  480. // function soundio_ring_buffer_read_ptr - soundio.h (1194, 22)
  481. [DllImport(LibraryName)]
  482. internal static extern System.IntPtr soundio_ring_buffer_read_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  483. // function soundio_ring_buffer_advance_read_ptr - soundio.h (1196, 21)
  484. [DllImport(LibraryName)]
  485. internal static extern void soundio_ring_buffer_advance_read_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer, int @count);
  486. // function soundio_ring_buffer_fill_count - soundio.h (1199, 20)
  487. [DllImport(LibraryName)]
  488. internal static extern int soundio_ring_buffer_fill_count([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  489. // function soundio_ring_buffer_free_count - soundio.h (1202, 20)
  490. [DllImport(LibraryName)]
  491. internal static extern int soundio_ring_buffer_free_count([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  492. // function soundio_ring_buffer_clear - soundio.h (1205, 21)
  493. [DllImport(LibraryName)]
  494. internal static extern void soundio_ring_buffer_clear([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
  495. }
  496. class Delegates
  497. {
  498. public delegate void delegate0(System.IntPtr p0);
  499. public delegate void delegate1(System.IntPtr p0, int p1);
  500. public delegate void delegate2();
  501. public delegate void delegate3(System.IntPtr p0);
  502. public delegate void delegate4(System.IntPtr p0, int p1, int p2);
  503. public delegate void delegate5(System.IntPtr p0);
  504. public delegate void delegate6(System.IntPtr p0, int p1);
  505. public delegate void delegate7(System.IntPtr p0, int p1, int p2);
  506. public delegate void delegate8(System.IntPtr p0);
  507. public delegate void delegate9(System.IntPtr p0, int p1);
  508. }
  509. public struct Pointer<T>
  510. {
  511. public IntPtr Handle;
  512. public static implicit operator IntPtr(Pointer<T> value) { return value.Handle; }
  513. public static implicit operator Pointer<T>(IntPtr value) { return new Pointer<T>(value); }
  514. public Pointer(IntPtr handle)
  515. {
  516. Handle = handle;
  517. }
  518. public override bool Equals(object obj)
  519. {
  520. return obj is Pointer<T> && this == (Pointer<T>)obj;
  521. }
  522. public override int GetHashCode()
  523. {
  524. return (int)Handle;
  525. }
  526. public static bool operator ==(Pointer<T> p1, Pointer<T> p2)
  527. {
  528. return p1.Handle == p2.Handle;
  529. }
  530. public static bool operator !=(Pointer<T> p1, Pointer<T> p2)
  531. {
  532. return p1.Handle != p2.Handle;
  533. }
  534. }
  535. public struct ArrayOf<T> { }
  536. public struct ConstArrayOf<T> { }
  537. public class CTypeDetailsAttribute : Attribute
  538. {
  539. public CTypeDetailsAttribute(string value)
  540. {
  541. Value = value;
  542. }
  543. public string Value { get; set; }
  544. }
  545. }