libpulse.vapi 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535
  1. /***
  2. This file is part of PulseAudio.
  3. Copyright 2009 Lennart Poettering
  4. PulseAudio is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published
  6. by the Free Software Foundation; either version 2.1 of the License,
  7. or (at your option) any later version.
  8. PulseAudio is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
  14. ***/
  15. using GLib;
  16. using Posix;
  17. [CCode (cheader_filename="pulse/pulseaudio.h")]
  18. namespace PulseAudio {
  19. [CCode (cname="pa_get_library_version")]
  20. public unowned string get_library_version();
  21. [CCode (cname="PA_API_VERSION")]
  22. public const int API_VERSION;
  23. [CCode (cname="PA_PROTOCOL_VERSION")]
  24. public const int PROTOCOL_VERSION;
  25. [CCode (cname="PA_MAJOR")]
  26. public const int MAJOR;
  27. [CCode (cname="PA_MINOR")]
  28. public const int MINOR;
  29. [CCode (cname="PA_MICRO")]
  30. public const int MICRO;
  31. [CCode (cname="PA_CHECK_VERSION")]
  32. public bool CHECK_VERSION(int major, int minor, int micro);
  33. [CCode (cname="PA_INVALID_INDEX")]
  34. public const uint32 INVALID_INDEX;
  35. [CCode (cname="pa_free_cb_t", has_target=false)]
  36. public delegate void FreeCb(void *p);
  37. [CCode (cname="pa_sample_format_t", cprefix="PA_SAMPLE_", has_type_id=false)]
  38. public enum SampleFormat {
  39. U8,
  40. ALAW,
  41. ULAW,
  42. S16LE,
  43. S16BE,
  44. FLOAT32LE,
  45. FLOAT32BE,
  46. S32LE,
  47. S32BE,
  48. S24LE,
  49. S24BE,
  50. S24_32LE,
  51. S24_32BE,
  52. MAX,
  53. S16NE,
  54. S16RE,
  55. FLOAT32NE,
  56. FLOAT32RE,
  57. S32NE,
  58. S32RE,
  59. S24NE,
  60. S24RE,
  61. S24_32NE,
  62. S24_32RE;
  63. [CCode (cname="pa_sample_size_of_format")]
  64. public size_t size();
  65. [CCode (cname="pa_sample_format_to_string")]
  66. public unowned string? to_string();
  67. [CCode (cname="pa_sample_format_is_le")]
  68. public int is_le();
  69. [CCode (cname="pa_sample_format_is_be")]
  70. public int is_be();
  71. [CCode (cname="pa_sample_format_is_ne")]
  72. public int is_ne();
  73. [CCode (cname="pa_sample_format_is_re")]
  74. public int is_re();
  75. [CCode (cname="pa_parse_sample_format")]
  76. public static SampleFormat parse(string b);
  77. }
  78. [CCode (cname="pa_usec_t")]
  79. public struct usec : uint64 {
  80. }
  81. [CCode (cname="pa_sample_spec", has_type_id=false)]
  82. public struct SampleSpec {
  83. public SampleFormat format;
  84. public uint32 rate;
  85. public uint8 channels;
  86. [CCode (cname="PA_SAMPLE_SPEC_SNPRINT_MAX")]
  87. public static const size_t SNPRINT_MAX;
  88. [CCode (cname="pa_bytes_per_second")]
  89. public size_t bytes_per_second();
  90. [CCode (cname="pa_frame_size")]
  91. public size_t frame_size();
  92. [CCode (cname="pa_sample_size")]
  93. public size_t sample_size();
  94. [CCode (cname="pa_bytes_to_usec", instance_pos=1.1)]
  95. public usec bytes_to_usec(size_t size);
  96. [CCode (cname="pa_usec_to_bytes", instance_pos=1.1)]
  97. public size_t usec_to_bytes(usec u);
  98. [CCode (cname="pa_sample_spec_init")]
  99. public unowned SampleSpec? init();
  100. [CCode (cname="pa_sample_spec_valid")]
  101. public bool valid();
  102. [CCode (cname="pa_sample_spec_equal")]
  103. public bool equal(SampleSpec other);
  104. [CCode (cname="pa_sample_spec_snprint", instance_pos=3.1)]
  105. public unowned string snprint(char[] buf);
  106. public string sprint() {
  107. var buffer = new char[SNPRINT_MAX];
  108. this.snprint(buffer);
  109. return (string) buffer;
  110. }
  111. public string to_string() {
  112. return sprint();
  113. }
  114. [CCode (cname="pa_sample_spec_init")]
  115. public SampleSpec();
  116. }
  117. // [CCode (cname="PA_BYTES_SNPRINT_MAX")]
  118. [CCode (cname="PA_SAMPLE_SPEC_SNPRINT_MAX")]
  119. public const size_t BYTES_SNPRINT_MAX;
  120. [CCode (cname="pa_bytes_snprint")]
  121. public unowned string bytes_snprint(char[] buf, uint bytes);
  122. public string bytes_sprint(uint bytes) {
  123. var buffer = new char[BYTES_SNPRINT_MAX];
  124. bytes_snprint(buffer, bytes);
  125. return (string) buffer;
  126. }
  127. [CCode (cname="pa_volume_t", has_type_id=false)]
  128. public struct Volume : uint32 {
  129. [CCode (cname="PA_SW_VOLUME_SNPRINT_DB_MAX")]
  130. public static const size_t SW_SNPRINT_DB_MAX;
  131. [CCode (cname="PA_VOLUME_SNPRINT_MAX")]
  132. public static const size_t SNPRINT_MAX;
  133. [CCode (cname="PA_VOLUME_MAX")]
  134. public static const Volume MAX;
  135. [CCode (cname="PA_VOLUME_NORM")]
  136. public static const Volume NORM;
  137. [CCode (cname="PA_VOLUME_MUTED")]
  138. public static const Volume MUTED;
  139. // [CCode (cname="PA_VOLUME_INVALID")]
  140. [CCode (cname="PA_VOLUME_MAX")]
  141. public static const Volume INVALID;
  142. [CCode (cname="pa_volume_snprint", instance_pos = 3.1)]
  143. public unowned string snprint(char[] s);
  144. public string sprint() {
  145. var buffer = new char[SNPRINT_MAX];
  146. this.snprint(buffer);
  147. return (string) buffer;
  148. }
  149. public string to_string() {
  150. return sprint();
  151. }
  152. [CCode (cname="pa_sw_volume_snprint_dB", instance_pos = 3.1)]
  153. public unowned string sw_snprint_dB(char[] s);
  154. public string sw_sprint_dB() {
  155. var buffer = new char[SW_SNPRINT_DB_MAX];
  156. this.sw_snprint_dB(buffer);
  157. return (string) buffer;
  158. }
  159. [CCode (cname="pa_sw_volume_multiply")]
  160. public Volume sw_multiply(Volume other);
  161. [CCode (cname="pa_sw_volume_divide")]
  162. public Volume sw_divide(Volume other);
  163. [CCode (cname="pa_sw_volume_from_dB")]
  164. public static Volume sw_from_dB(double f);
  165. [CCode (cname="pa_sw_volume_to_dB")]
  166. public double sw_to_dB();
  167. [CCode (cname="pa_sw_volume_from_linear")]
  168. public static Volume sw_from_linear(double f);
  169. [CCode (cname="pa_sw_volume_to_linear")]
  170. public double sw_to_linear();
  171. }
  172. [CCode (cname="PA_DECIBEL_MININFTY")]
  173. public const double DECIBEL_MININFTY;
  174. [CCode (cname="PA_CHANNELS_MAX")]
  175. public const int CHANNELS_MAX;
  176. [CCode (cname="PA_RATE_MAX")]
  177. public const int RATE_MAX;
  178. [CCode (cname="pa_cvolume", has_type_id=false)]
  179. public struct CVolume {
  180. public uint8 channels;
  181. // TODO: Replace array length with CHANNELS_MAX once vala's bug #647788 is fixed
  182. public Volume values[32];
  183. [CCode (cname="PA_SW_CVOLUME_SNPRINT_DB_MAX")]
  184. public static const size_t SW_SNPRINT_DB_MAX;
  185. [CCode (cname="PA_CVOLUME_SNPRINT_MAX")]
  186. public static const size_t SNPRINT_MAX;
  187. [CCode (cname="pa_cvolume_equal")]
  188. public bool equal(CVolume other);
  189. [CCode (cname="pa_cvolume_init")]
  190. public unowned CVolume? init();
  191. [CCode (cname="pa_cvolume_reset")]
  192. public unowned CVolume? reset(uint8 channels);
  193. [CCode (cname="pa_cvolume_mute")]
  194. public unowned CVolume? mute(uint8 channels);
  195. [CCode (cname="pa_cvolume_snprint", instance_pos = 3.1)]
  196. public unowned string snprint(char[] s);
  197. public string sprint() {
  198. var buffer = new char[SNPRINT_MAX];
  199. this.snprint(buffer);
  200. return (string) buffer;
  201. }
  202. public string to_string() {
  203. return sprint();
  204. }
  205. [CCode (cname="pa_sw_cvolume_snprint_dB", instance_pos = 3.1)]
  206. public unowned string sw_snprint_dB(char [] s);
  207. public string sw_sprint_dB() {
  208. var buffer = new char[SW_SNPRINT_DB_MAX];
  209. this.sw_snprint_dB(buffer);
  210. return (string) buffer;
  211. }
  212. [CCode (cname="pa_cvolume_init")]
  213. public CVolume();
  214. [CCode (cname="pa_cvolume_avg")]
  215. public Volume avg();
  216. [CCode (cname="pa_cvolume_max")]
  217. public Volume max();
  218. [CCode (cname="pa_cvolume_min")]
  219. public Volume min();
  220. [CCode (cname="pa_cvolume_avg_mask")]
  221. public Volume avg_mask(ChannelMap map, ChannelPositionMask mask);
  222. [CCode (cname="pa_cvolume_max_mask")]
  223. public Volume max_mask(ChannelMap map, ChannelPositionMask mask);
  224. [CCode (cname="pa_cvolume_min_mask")]
  225. public Volume min_mask(ChannelMap map, ChannelPositionMask mask);
  226. [CCode (cname="pa_cvolume_valid")]
  227. public bool valid();
  228. [CCode (cname="pa_cvolume_channels_equal_to")]
  229. public bool channels_equal_to(Volume other);
  230. [CCode (cname="pa_cvolume_is_muted")]
  231. public bool is_muted();
  232. [CCode (cname="pa_cvolume_is_norm")]
  233. public bool is_norm();
  234. [CCode (cname="pa_sw_cvolume_multiply")]
  235. public unowned CVolume? multiply(CVolume other);
  236. [CCode (cname="pa_sw_cvolume_divide")]
  237. public unowned CVolume? divide(CVolume other);
  238. [CCode (cname="pa_sw_cvolume_multiply_scalar")]
  239. public unowned CVolume? multiply_scalar(Volume other);
  240. [CCode (cname="pa_sw_cvolume_divide_scalar")]
  241. public unowned CVolume? divide_scalar(Volume other);
  242. [CCode (cname="pa_cvolume_remap")]
  243. public unowned CVolume? remap(ChannelMap from, ChannelMap to);
  244. [CCode (cname="pa_cvolume_compatible")]
  245. public bool compatible(SampleSpec ss);
  246. [CCode (cname="pa_cvolume_compatible_with_channel_map")]
  247. public bool compatible_with_channel_map(ChannelMap cm);
  248. [CCode (cname="pa_cvolume_set")]
  249. public unowned CVolume? set(uint8 channels, Volume v);
  250. [CCode (cname="pa_cvolume_get_balance")]
  251. public float get_balance(ChannelMap map);
  252. [CCode (cname="pa_cvolume_set_balance")]
  253. public unowned CVolume? set_balance(ChannelMap map, float b);
  254. [CCode (cname="pa_cvolume_get_fade")]
  255. public float get_fade(ChannelMap map);
  256. [CCode (cname="pa_cvolume_set_fade")]
  257. public unowned CVolume? set_fade(ChannelMap map, float f);
  258. [CCode (cname="pa_cvolume_scale")]
  259. public unowned CVolume? scale(Volume max);
  260. [CCode (cname="pa_cvolume_scale_mask")]
  261. public unowned CVolume? scale_mask(Volume max, ChannelMap map, ChannelPositionMask mask);
  262. [CCode (cname="pa_cvolume_set_position")]
  263. public unowned CVolume? set_position(ChannelMap map, ChannelPosition p, Volume v);
  264. [CCode (cname="pa_cvolume_get_position")]
  265. public Volume get_position(ChannelMap map, ChannelPosition p);
  266. [CCode (cname="pa_cvolume_merge")]
  267. public unowned CVolume? merge(CVolume other);
  268. [CCode (cname="pa_cvolume_inc")]
  269. public unowned CVolume? inc(Volume plus = 1);
  270. [CCode (cname="pa_cvolume_dec")]
  271. public unowned CVolume? dec(Volume minus = 1);
  272. }
  273. [CCode (cname="pa_channel_map", has_type_id=false)]
  274. public struct ChannelMap {
  275. public uint8 channels;
  276. // TODO: Replace array length with CHANNELS_MAX once vala's bug #647788 is fixed
  277. public ChannelPosition map[32];
  278. [CCode (cname="PA_CHANNEL_MAP_SNPRINT_MAX")]
  279. public static const size_t SNPRINT_MAX;
  280. [CCode (cname="pa_channel_map_init")]
  281. public ChannelMap();
  282. [CCode (cname="pa_channel_map_init")]
  283. public unowned ChannelMap? init();
  284. [CCode (cname="pa_channel_map_init_mono")]
  285. public unowned ChannelMap? init_mono();
  286. [CCode (cname="pa_channel_map_init_stereo")]
  287. public unowned ChannelMap? init_stereo();
  288. [CCode (cname="pa_channel_map_init_auto")]
  289. public unowned ChannelMap? init_auto(uint8 channels, ChannelMapDef def = ChannelMapDef.DEFAULT);
  290. [CCode (cname="pa_channel_map_init_extend")]
  291. public unowned ChannelMap? init_extend(uint8 channels, ChannelMapDef def = ChannelMapDef.DEFAULT);
  292. [CCode (cname="pa_channel_map_snprint", instance_pos = 3.1)]
  293. public unowned string snprint(char[] s);
  294. public string sprint() {
  295. var buffer = new char[SNPRINT_MAX];
  296. this.snprint(buffer);
  297. return (string) buffer;
  298. }
  299. public string to_string() {
  300. return sprint();
  301. }
  302. [CCode (cname="pa_channel_map_parse")]
  303. public unowned ChannelMap? parse(string s);
  304. [CCode (cname="pa_channel_map_equal")]
  305. public bool equal(ChannelMap other);
  306. [CCode (cname="pa_channel_map_superset")]
  307. public bool superset(ChannelMap other);
  308. [CCode (cname="pa_channel_map_valid")]
  309. public bool valid();
  310. [CCode (cname="pa_channel_map_compatible")]
  311. public bool compatible(SampleSpec ss);
  312. [CCode (cname="pa_channel_map_can_balance")]
  313. public bool can_balance();
  314. [CCode (cname="pa_channel_map_can_fade")]
  315. public bool can_fade();
  316. [CCode (cname="pa_channel_map_to_name")]
  317. public unowned string? to_name();
  318. [CCode (cname="pa_channel_map_to_pretty_name")]
  319. public unowned string? to_pretty_name();
  320. [CCode (cname="pa_channel_map_has_position")]
  321. public bool has_position(ChannelPosition p);
  322. [CCode (cname="pa_channel_map_mask")]
  323. public ChannelPositionMask mask();
  324. }
  325. [CCode (cname="pa_channel_position_mask_t", has_type_id=false)]
  326. public struct ChannelPositionMask : uint64 {
  327. }
  328. [CCode (cname="pa_channel_position_t", cprefix="PA_CHANNEL_POSITION_", has_type_id=false)]
  329. public enum ChannelPosition {
  330. INVALID,
  331. MONO,
  332. FRONT_LEFT,
  333. FRONT_RIGHT,
  334. FRONT_CENTER,
  335. REAR_CENTER,
  336. REAR_LEFT,
  337. REAR_RIGHT,
  338. LFE,
  339. FRONT_LEFT_OF_CENTER,
  340. FRONT_RIGHT_OF_CENTER,
  341. SIDE_LEFT,
  342. SIDE_RIGHT,
  343. TOP_CENTER,
  344. AUX0,
  345. AUX1,
  346. AUX2,
  347. AUX3,
  348. AUX4,
  349. AUX5,
  350. AUX6,
  351. AUX7,
  352. AUX8,
  353. AUX9,
  354. AUX10,
  355. AUX11,
  356. AUX12,
  357. AUX13,
  358. AUX14,
  359. AUX15,
  360. AUX16,
  361. AUX17,
  362. AUX18,
  363. AUX19,
  364. AUX20,
  365. AUX21,
  366. AUX22,
  367. AUX23,
  368. AUX24,
  369. AUX25,
  370. AUX26,
  371. AUX27,
  372. AUX28,
  373. AUX29,
  374. AUX30,
  375. AUX31,
  376. MAX;
  377. [CCode (cname="PA_CHANNEL_POSITION_MASK")]
  378. public ChannelPositionMask mask();
  379. [CCode (cname="pa_channel_position_to_string")]
  380. public unowned string? to_string();
  381. [CCode (cname="pa_channel_position_to_pretty_string")]
  382. public unowned string? to_pretty_string();
  383. [CCode (cname="pa_channel_position_from_string")]
  384. public static ChannelPosition from_string(string s);
  385. }
  386. [CCode (cname="pa_channel_map_def_t", cprefix="PA_CHANNEL_MAP_", has_type_id=false)]
  387. public enum ChannelMapDef {
  388. AIFF,
  389. WAVEEX,
  390. AUX,
  391. DEFAULT,
  392. [CCode (cname="PA_CHANNEL_MAP_DEF_MAX")]
  393. MAX
  394. }
  395. [Compact]
  396. [CCode (cname="pa_proplist", cprefix="pa_proplist_", free_function="pa_proplist_free", has_type_id=false)]
  397. public class Proplist {
  398. [CCode (cname="PA_PROP_MEDIA_NAME")]
  399. public static const string PROP_MEDIA_NAME;
  400. [CCode (cname="PA_PROP_MEDIA_TITLE")]
  401. public static const string PROP_MEDIA_TITLE;
  402. [CCode (cname="PA_PROP_MEDIA_ARTIST")]
  403. public static const string PROP_MEDIA_ARTIST;
  404. [CCode (cname="PA_PROP_MEDIA_COPYRIGHT")]
  405. public static const string PROP_MEDIA_COPYRIGHT;
  406. [CCode (cname="PA_PROP_MEDIA_SOFTWARE")]
  407. public static const string PROP_MEDIA_SOFTWARE;
  408. [CCode (cname="PA_PROP_MEDIA_LANGUAGE")]
  409. public static const string PROP_MEDIA_LANGUAGE;
  410. [CCode (cname="PA_PROP_MEDIA_FILENAME")]
  411. public static const string PROP_MEDIA_FILENAME;
  412. [CCode (cname="PA_PROP_MEDIA_ICON_NAME")]
  413. public static const string PROP_MEDIA_ICON_NAME;
  414. [CCode (cname="PA_PROP_MEDIA_ROLE")]
  415. public static const string PROP_MEDIA_ROLE;
  416. [CCode (cname="PA_PROP_EVENT_ID")]
  417. public static const string PROP_EVENT_ID;
  418. [CCode (cname="PA_PROP_EVENT_DESCRIPTION")]
  419. public static const string PROP_EVENT_DESCRIPTION;
  420. [CCode (cname="PA_PROP_EVENT_MOUSE_X")]
  421. public static const string PROP_EVENT_MOUSE_X;
  422. [CCode (cname="PA_PROP_EVENT_MOUSE_Y")]
  423. public static const string PROP_EVENT_MOUSE_Y;
  424. [CCode (cname="PA_PROP_EVENT_MOUSE_HPOS")]
  425. public static const string PROP_EVENT_MOUSE_HPOS;
  426. [CCode (cname="PA_PROP_EVENT_MOUSE_VPOS")]
  427. public static const string PROP_EVENT_MOUSE_VPOS;
  428. [CCode (cname="PA_PROP_EVENT_MOUSE_BUTTON")]
  429. public static const string PROP_EVENT_MOUSE_BUTTON;
  430. [CCode (cname="PA_PROP_WINDOW_NAME")]
  431. public static const string PROP_WINDOW_NAME;
  432. [CCode (cname="PA_PROP_WINDOW_ID")]
  433. public static const string PROP_WINDOW_ID;
  434. [CCode (cname="PA_PROP_WINDOW_ICON_NAME")]
  435. public static const string PROP_WINDOW_ICON_NAME;
  436. [CCode (cname="PA_PROP_WINDOW_X11_DISPLAY")]
  437. public static const string PROP_WINDOW_X11_DISPLAY;
  438. [CCode (cname="PA_PROP_WINDOW_X11_SCREEN")]
  439. public static const string PROP_WINDOW_X11_SCREEN;
  440. [CCode (cname="PA_PROP_WINDOW_X11_MONITOR")]
  441. public static const string PROP_WINDOW_X11_MONITOR;
  442. [CCode (cname="PA_PROP_WINDOW_X11_XID")]
  443. public static const string PROP_WINDOW_X11_XID;
  444. [CCode (cname="PA_PROP_APPLICATION_NAME")]
  445. public static const string PROP_APPLICATION_NAME;
  446. [CCode (cname="PA_PROP_APPLICATION_ID")]
  447. public static const string PROP_APPLICATION_ID;
  448. [CCode (cname="PA_PROP_APPLICATION_VERSION")]
  449. public static const string PROP_APPLICATION_VERSION;
  450. [CCode (cname="PA_PROP_APPLICATION_ICON_NAME")]
  451. public static const string PROP_APPLICATION_ICON_NAME;
  452. [CCode (cname="PA_PROP_APPLICATION_LANGUAGE")]
  453. public static const string PROP_APPLICATION_LANGUAGE;
  454. [CCode (cname="PA_PROP_APPLICATION_PROCESS_ID")]
  455. public static const string PROP_APPLICATION_PROCESS_ID;
  456. [CCode (cname="PA_PROP_APPLICATION_PROCESS_BINARY")]
  457. public static const string PROP_APPLICATION_PROCESS_BINARY;
  458. [CCode (cname="PA_PROP_APPLICATION_PROCESS_USER")]
  459. public static const string PROP_APPLICATION_PROCESS_USER;
  460. [CCode (cname="PA_PROP_APPLICATION_PROCESS_HOST")]
  461. public static const string PROP_APPLICATION_PROCESS_HOST;
  462. [CCode (cname="PA_PROP_APPLICATION_PROCESS_MACHINE_ID")]
  463. public static const string PROP_APPLICATION_PROCESS_MACHINE_ID;
  464. [CCode (cname="PA_PROP_APPLICATION_PROCESS_SESSION_ID")]
  465. public static const string PROP_APPLICATION_PROCESS_SESSION_ID;
  466. [CCode (cname="PA_PROP_DEVICE_STRING")]
  467. public static const string PROP_DEVICE_STRING;
  468. [CCode (cname="PA_PROP_DEVICE_API")]
  469. public static const string PROP_DEVICE_API;
  470. [CCode (cname="PA_PROP_DEVICE_DESCRIPTION")]
  471. public static const string PROP_DEVICE_DESCRIPTION;
  472. [CCode (cname="PA_PROP_DEVICE_BUS_PATH")]
  473. public static const string PROP_DEVICE_BUS_PATH;
  474. [CCode (cname="PA_PROP_DEVICE_SERIAL")]
  475. public static const string PROP_DEVICE_SERIAL;
  476. [CCode (cname="PA_PROP_DEVICE_VENDOR_ID")]
  477. public static const string PROP_DEVICE_VENDOR_ID;
  478. [CCode (cname="PA_PROP_DEVICE_VENDOR_NAME")]
  479. public static const string PROP_DEVICE_VENDOR_NAME;
  480. [CCode (cname="PA_PROP_DEVICE_PRODUCT_ID")]
  481. public static const string PROP_DEVICE_PRODUCT_ID;
  482. [CCode (cname="PA_PROP_DEVICE_PRODUCT_NAME")]
  483. public static const string PROP_DEVICE_PRODUCT_NAME;
  484. [CCode (cname="PA_PROP_DEVICE_CLASS")]
  485. public static const string PROP_DEVICE_CLASS;
  486. [CCode (cname="PA_PROP_DEVICE_FORM_FACTOR")]
  487. public static const string PROP_DEVICE_FORM_FACTOR;
  488. [CCode (cname="PA_PROP_DEVICE_BUS")]
  489. public static const string PROP_DEVICE_BUS;
  490. [CCode (cname="PA_PROP_DEVICE_ICON_NAME")]
  491. public static const string PROP_DEVICE_ICON_NAME;
  492. [CCode (cname="PA_PROP_DEVICE_ACCESS_MODE")]
  493. public static const string PROP_DEVICE_ACCESS_MODE;
  494. [CCode (cname="PA_PROP_DEVICE_MASTER_DEVICE")]
  495. public static const string PROP_DEVICE_MASTER_DEVICE;
  496. [CCode (cname="PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE")]
  497. public static const string PROP_DEVICE_BUFFERING_BUFFER_SIZE;
  498. [CCode (cname="PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE")]
  499. public static const string PROP_DEVICE_BUFFERING_FRAGMENT_SIZE;
  500. [CCode (cname="PA_PROP_DEVICE_PROFILE_NAME")]
  501. public static const string PROP_DEVICE_PROFILE_NAME;
  502. [CCode (cname="PA_PROP_DEVICE_INTENDED_ROLES")]
  503. public static const string PROP_DEVICE_INTENDED_ROLES;
  504. [CCode (cname="PA_PROP_DEVICE_PROFILE_DESCRIPTION")]
  505. public static const string PROP_DEVICE_PROFILE_DESCRIPTION;
  506. [CCode (cname="PA_PROP_MODULE_AUTHOR")]
  507. public static const string PROP_MODULE_AUTHOR;
  508. [CCode (cname="PA_PROP_MODULE_DESCRIPTION")]
  509. public static const string PROP_MODULE_DESCRIPTION;
  510. [CCode (cname="PA_PROP_MODULE_USAGE")]
  511. public static const string PROP_MODULE_USAGE;
  512. [CCode (cname="PA_PROP_MODULE_VERSION")]
  513. public static const string PROP_MODULE_VERSION;
  514. [CCode (cname="pa_proplist_new")]
  515. public Proplist();
  516. public int sets(string key, string value);
  517. public int setp(string pair);
  518. [PrintfFormat]
  519. public int setf(string key, string format, ...);
  520. public int set(string key, void* data, size_t size);
  521. public unowned string? gets(string key);
  522. public int get(string key, out void* data, out size_t size);
  523. public void update(UpdateMode mode, Proplist other);
  524. public void unset(string key);
  525. [CCode (array_length = false)]
  526. public void unset_many(string[] key);
  527. public unowned string? iterate(ref void* state);
  528. public string to_string();
  529. public string to_string_sep(string sep);
  530. public static Proplist? from_string(string s);
  531. public int contains(string key);
  532. public void clear();
  533. public Proplist copy();
  534. public uint size();
  535. public bool is_empty();
  536. }
  537. [CCode (cname="pa_update_mode_t", cprefix="PA_UPDATE_", has_type_id=false)]
  538. public enum UpdateMode {
  539. SET,
  540. MERGE,
  541. REPLACE
  542. }
  543. [CCode (cname="PA_OK")]
  544. public const int OK;
  545. [CCode (cname="int", cprefix="PA_ERR_", has_type_id=false)]
  546. public enum Error {
  547. ACCESS,
  548. COMMAND,
  549. INVALID,
  550. EXIST,
  551. NOENTITY,
  552. CONNECTIONREFUSED,
  553. PROTOCOL,
  554. TIMEOUT,
  555. AUTHKEY,
  556. INTERNAL,
  557. CONNECTIONTERMINATED,
  558. KILLED,
  559. INVALIDSERVER,
  560. MODINITFAILED,
  561. BADSTATE,
  562. NODATA,
  563. VERSION,
  564. TOOLARGE,
  565. NOTSUPPORTED,
  566. UNKNOWN,
  567. NOEXTENSION,
  568. OBSOLETE,
  569. NOTIMPLEMENTED,
  570. FORKED,
  571. IO,
  572. MAX
  573. }
  574. [CCode (cname="pa_strerror")]
  575. public unowned string? strerror(Error e);
  576. public delegate void VoidFunc();
  577. [CCode (cname="pa_spawn_api", has_type_id=false)]
  578. public struct SpawnApi {
  579. VoidFunc? prefork;
  580. VoidFunc? postfork;
  581. VoidFunc? atfork;
  582. }
  583. [CCode (cname="pa_io_event_flags_t", cprefix="PA_IO_EVENT_", has_type_id=false)]
  584. public enum IoEventFlags {
  585. NULL,
  586. INPUT,
  587. OUTPUT,
  588. HANGUP,
  589. ERROR
  590. }
  591. [Compact]
  592. [CCode (cname="pa_io_event", unref_function="", ref_function="", has_type_id=false)]
  593. public struct IoEvent {
  594. }
  595. [Compact]
  596. [CCode (cname="pa_time_event", unref_function="", ref_function="", has_type_id=false)]
  597. public struct TimeEvent {
  598. }
  599. [Compact]
  600. [CCode (cname="pa_defer_event", unref_function="", ref_function="", has_type_id=false)]
  601. public struct DeferEvent {
  602. }
  603. [Compact]
  604. [CCode (cname="pa_signal_event", cprefix="pa_signal_", free_function="pa_signal_free", has_type_id=false)]
  605. public struct SignalEvent {
  606. [CCode (cname="pa_signal_new")]
  607. public SignalEvent(int sig, MainLoopApi.SignalEventCb cb);
  608. public void set_destroy(MainLoopApi.SignalEventDestroyCb cb);
  609. }
  610. [Compact]
  611. [CCode (cname="pa_mainloop_api", unref_function="", ref_function="", has_type_id=false)]
  612. public class MainLoopApi {
  613. public void* userdata;
  614. /* Callbacks for the consumer to implement*/
  615. public delegate void IoEventCb(MainLoopApi a, IoEvent e, int fd, IoEventFlags flags);
  616. public delegate void IoEventDestroyCb(MainLoopApi a, IoEvent e);
  617. public delegate void TimeEventCb(MainLoopApi a, TimeEvent e, ref timeval t);
  618. public delegate void TimeEventDestroyCb(MainLoopApi a, TimeEvent e);
  619. public delegate void DeferEventCb(MainLoopApi a, DeferEvent e);
  620. public delegate void DeferEventDestroyCb(MainLoopApi a, DeferEvent e);
  621. public delegate void SignalEventCb(MainLoopApi a, SignalEvent e);
  622. public delegate void SignalEventDestroyCb(MainLoopApi a, SignalEvent e);
  623. /* Callbacks for the provider to implement */
  624. public delegate IoEvent IoNewCb(MainLoopApi a, int fd, IoEventFlags flags, IoEventCb cb);
  625. public delegate void IoEnableCb(MainLoopApi a, IoEvent e, IoEventFlags flags);
  626. public delegate void IoFreeCb(MainLoopApi a, IoEvent e);
  627. public delegate void IoSetDestroyCb(MainLoopApi a, IoEvent e, IoEventDestroyCb? cb);
  628. public delegate TimeEvent TimeNewCb(MainLoopApi a, timeval? t, TimeEventCb cb);
  629. public delegate void TimeRestartCb(MainLoopApi a, TimeEvent e, timeval? t);
  630. public delegate void TimeFreeCb(MainLoopApi a, TimeEvent e);
  631. public delegate void TimeSetDestroyCb(MainLoopApi a, TimeEvent e, TimeEventDestroyCb? cb);
  632. public delegate DeferEvent DeferNewCb(MainLoopApi a, DeferEventCb cb);
  633. public delegate void DeferEnableCb(MainLoopApi a, DeferEvent e, bool b);
  634. public delegate void DeferFreeCb(MainLoopApi a, DeferEvent e);
  635. public delegate void DeferSetDestroyCb(MainLoopApi a, DeferEvent e, DeferEventDestroyCb? cb);
  636. public delegate void QuitCb(MainLoopApi a, int retval);
  637. public delegate void OnceCb(MainLoopApi a);
  638. public IoNewCb io_new;
  639. public IoEnableCb io_enable;
  640. public IoFreeCb io_free;
  641. public IoSetDestroyCb io_set_destroy;
  642. public TimeNewCb time_new;
  643. public TimeRestartCb time_restart;
  644. public TimeFreeCb time_free;
  645. public TimeSetDestroyCb time_set_destroy;
  646. public DeferNewCb defer_new;
  647. public DeferEnableCb defer_enable;
  648. public DeferFreeCb defer_free;
  649. public DeferSetDestroyCb defer_set_destroy;
  650. public QuitCb quit;
  651. [CCode (cname="pa_mainloop_api_once")]
  652. public void once(OnceCb cb);
  653. }
  654. [CCode (cname="pa_signal_init")]
  655. public void signal_init(MainLoopApi api);
  656. [CCode (cname="pa_signal_done")]
  657. public void signal_done();
  658. [CCode (cname="pa_poll_func")]
  659. public delegate int PollFunc(pollfd[] ufds, int timeout);
  660. [Compact]
  661. [CCode (cname="pa_mainloop", cprefix="pa_mainloop_", free_function="pa_mainloop_free", has_type_id=false)]
  662. public class MainLoop {
  663. [CCode (cname="pa_mainloop_new")]
  664. public MainLoop();
  665. public int prepare(int timeout = -1);
  666. public int poll();
  667. public int dispatch();
  668. public int get_retval();
  669. public int iterate(bool block = true, out int retval = null);
  670. public int run(out int retval = null);
  671. public unowned MainLoopApi get_api();
  672. public void quit(int retval);
  673. public void wakeup();
  674. public void set_poll_func(PollFunc poll_func);
  675. }
  676. [Compact]
  677. [CCode (cname="pa_threaded_mainloop", cprefix="pa_threaded_mainloop_", free_function="pa_threaded_mainloop_free")]
  678. public class ThreadedMainLoop {
  679. [CCode (cname="pa_threaded_mainloop_new")]
  680. public ThreadedMainLoop();
  681. public int start();
  682. public void stop();
  683. public void lock();
  684. public void unlock();
  685. public void wait();
  686. public void signal(bool WaitForAccept = false);
  687. public void accept();
  688. public int get_retval();
  689. public unowned MainLoopApi get_api();
  690. public bool in_thread();
  691. }
  692. [Compact]
  693. [CCode (cname="pa_operation", cprefix="pa_operation_", unref_function="pa_operation_unref", ref_function="pa_operation_ref", has_type_id=false)]
  694. public class Operation {
  695. [CCode (cname="pa_operation_state_t", cprefix="PA_OPERATION_", has_type_id=false)]
  696. public enum State {
  697. RUNNING,
  698. DONE,
  699. CANCELED
  700. }
  701. public void cancel();
  702. public State get_state();
  703. }
  704. [Compact]
  705. [CCode (cname="pa_context", cprefix="pa_context_", unref_function="pa_context_unref", ref_function="pa_context_ref", has_type_id=false)]
  706. public class Context {
  707. [CCode (cname="pa_context_flags_t", cprefix="PA_CONTEXT_", has_type_id=false)]
  708. public enum Flags {
  709. NOAUTOSPAWN,
  710. NOFAIL
  711. }
  712. [CCode (cname="pa_context_state_t", cprefix="PA_CONTEXT_", has_type_id=false)]
  713. public enum State {
  714. UNCONNECTED,
  715. CONNECTING,
  716. AUTHORIZING,
  717. SETTING_NAME,
  718. READY,
  719. FAILED,
  720. TERMINATED;
  721. [CCode (cname="PA_CONTEXT_IS_GOOD", has_type_id=false)]
  722. public bool IS_GOOD();
  723. }
  724. [CCode (cname="pa_subscription_mask_t", cprefix="PA_SUBSCRIPTION_MASK_", has_type_id=false)]
  725. public enum SubscriptionMask {
  726. NULL,
  727. SINK,
  728. SOURCE,
  729. SINK_INPUT,
  730. SOURCE_OUTPUT,
  731. MODULE,
  732. CLIENT,
  733. SAMPLE_CACHE,
  734. SERVER,
  735. CARD,
  736. ALL;
  737. [CCode (cname="pa_subscription_match_flags")]
  738. public bool match_flags(SubscriptionEventType t);
  739. }
  740. [CCode (cname="pa_subscription_event_type_t", cprefix="PA_SUBSCRIPTION_EVENT_", has_type_id=false)]
  741. public enum SubscriptionEventType {
  742. SINK,
  743. SOURCE,
  744. SINK_INPUT,
  745. SOURCE_OUTPUT,
  746. MODULE,
  747. CLIENT,
  748. SAMPLE_CACHE,
  749. SERVER,
  750. CARD,
  751. FACILITY_MASK,
  752. NEW,
  753. CHANGE,
  754. REMOVE,
  755. TYPE_MASK
  756. }
  757. [CCode (cname = "pa_context_notify_cb_t")]
  758. public delegate void NotifyCb(Context c);
  759. [CCode (cname = "pa_context_success_cb_t")]
  760. public delegate void SuccessCb(Context c, int success);
  761. [CCode (cname = "pa_context_event_cb_t")]
  762. public delegate void EventCb(Context c, string name, Proplist? proplist);
  763. [CCode (cname = "pa_context_subscribe_cb_t")]
  764. public delegate void SubscribeCb(Context c, SubscriptionEventType t, uint32 idx);
  765. [CCode (cname = "pa_sink_info_cb_t")]
  766. public delegate void SinkInfoCb(Context c, SinkInfo? i, int eol);
  767. [CCode (cname = "pa_source_info_cb_t")]
  768. public delegate void SourceInfoCb(Context c, SourceInfo? i, int eol);
  769. [CCode (cname = "pa_card_info_cb_t")]
  770. public delegate void CardInfoCb(Context c, CardInfo? i, int eol);
  771. [CCode (cname = "pa_sink_input_info_cb_t")]
  772. public delegate void SinkInputInfoCb(Context c, SinkInputInfo? i, int eol);
  773. [CCode (cname = "pa_source_output_info_cb_t")]
  774. public delegate void SourceOutputInfoCb(Context c, SourceOutputInfo? i, int eol);
  775. [CCode (cname = "pa_server_info_cb_t")]
  776. public delegate void ServerInfoCb(Context c, ServerInfo? i);
  777. [CCode (cname = "pa_stat_info_cb_t")]
  778. public delegate void StatInfoCb(Context c, ServerInfo? i);
  779. [CCode (cname = "pa_module_info_cb_t")]
  780. public delegate void ModuleInfoCb(Context c, ModuleInfo? i, int eol);
  781. [CCode (cname = "pa_client_info_cb_t")]
  782. public delegate void ClientInfoCb(Context c, ClientInfo? i, int eol);
  783. [CCode (cname = "pa_sample_info_cb_t")]
  784. public delegate void SampleInfoCb(Context c, SampleInfo? i, int eol);
  785. [CCode (cname = "pa_context_index_cb_t")]
  786. public delegate void IndexCb(Context c, uint32 idx);
  787. [CCode (cname="pa_context_new_with_proplist")]
  788. public Context(MainLoopApi api, string? name, Proplist? proplist = null);
  789. public void set_state_callback(NotifyCb? cb = null);
  790. public void set_event_callback(EventCb? cb = null);
  791. public void set_subscribe_callback(SubscribeCb? cb = null);
  792. public Error errno();
  793. public int is_pending();
  794. public State get_state();
  795. public int is_local();
  796. public unowned string? get_server();
  797. public uint32 get_protocol_version();
  798. public uint32 get_server_protocol_version();
  799. public uint32 get_index();
  800. public int connect(string? server = null, Flags flags = 0, SpawnApi? api = null);
  801. public void disconnect();
  802. public Operation? drain(NotifyCb? cb = null);
  803. public Operation? exit_daemon(SuccessCb? cb = null);
  804. public Operation? set_default_sink(string name, SuccessCb? cb = null);
  805. public Operation? set_default_source(string name, SuccessCb? cb = null);
  806. public Operation? set_name(string name, SuccessCb? cb = null);
  807. [CCode (array_length = false)]
  808. public Operation? proplist_remove(string[] keys, SuccessCb? cb = null);
  809. public Operation? proplist_update(UpdateMode mode, Proplist pl, SuccessCb? cb = null);
  810. public Operation? subscribe(SubscriptionMask mask, SuccessCb? cb = null);
  811. public Operation? get_sink_info_by_name(string name, SinkInfoCb cb);
  812. public Operation? get_sink_info_by_index(uint32 idx, SinkInfoCb cb);
  813. public Operation? get_sink_info_list(SinkInfoCb cb);
  814. public Operation? set_sink_volume_by_name(string name, CVolume volume, SuccessCb? cb = null);
  815. public Operation? set_sink_volume_by_index(uint32 idx, CVolume volume, SuccessCb? cb = null);
  816. public Operation? set_sink_mute_by_name(string name, bool mute, SuccessCb? cb = null);
  817. public Operation? set_sink_mute_by_index(uint32 idx, bool mute, SuccessCb? cb = null);
  818. public Operation? suspend_sink_by_name(string name, bool suspend, SuccessCb? cb = null);
  819. public Operation? suspend_sink_by_index(uint32 idx, bool suspend, SuccessCb? cb = null);
  820. public Operation? set_sink_port_by_name(string name, string port, SuccessCb? cb = null);
  821. public Operation? set_sink_port_by_index(uint32 idx, string port, SuccessCb? cb = null);
  822. public Operation? get_source_info_by_name(string name, SourceInfoCb cb);
  823. public Operation? get_source_info_by_index(uint32 idx, SourceInfoCb cb);
  824. public Operation? get_source_info_list(SourceInfoCb cb);
  825. public Operation? set_source_volume_by_name(string name, CVolume volume, SuccessCb? cb = null);
  826. public Operation? set_source_volume_by_index(uint32 idx, CVolume volume, SuccessCb? cb = null);
  827. public Operation? set_source_mute_by_name(string name, bool mute, SuccessCb? cb = null);
  828. public Operation? set_source_mute_by_index(uint32 idx, bool mute, SuccessCb? cb = null);
  829. public Operation? suspend_source_by_name(string name, bool suspend, SuccessCb? cb = null);
  830. public Operation? suspend_source_by_index(uint32 idx, bool suspend, SuccessCb? cb = null);
  831. public Operation? set_source_port_by_name(string name, string port, SuccessCb? cb = null);
  832. public Operation? set_source_port_by_index(uint32 idx, string port, SuccessCb? cb = null);
  833. public Operation? get_server_info(ServerInfoCb cb);
  834. public Operation? get_module_info(uint32 idx, ModuleInfoCb cb);
  835. public Operation? get_module_info_list(ModuleInfoCb cb);
  836. public Operation? load_module(string name, string? argument, IndexCb? cb = null);
  837. public Operation? unload_module(uint32 idx, SuccessCb? cb = null);
  838. public Operation? get_client_info(uint32 idx, ClientInfoCb cb);
  839. public Operation? get_client_info_list(ClientInfoCb cb);
  840. public Operation? kill_client(uint32 idx, SuccessCb? cb = null);
  841. public Operation? get_card_info_by_name(string name, CardInfoCb cb);
  842. public Operation? get_card_info_by_index(uint32 idx, CardInfoCb cb);
  843. public Operation? get_card_info_list(CardInfoCb cb);
  844. public Operation? set_card_profile_by_index(uint32 idx, string profile, SuccessCb? cb = null);
  845. public Operation? set_card_profile_by_name(string name, string profile, SuccessCb? cb = null);
  846. public Operation? get_sink_input_info(uint32 idx, SinkInputInfoCb cb);
  847. public Operation? get_sink_input_info_list(SinkInputInfoCb cb);
  848. public Operation? move_sink_input_by_index(uint32 idx, uint32 sink_idx, SuccessCb? cb = null);
  849. public Operation? move_sink_input_by_name(uint32 idx, string sink_name, SuccessCb? cb = null);
  850. public Operation? set_sink_input_volume(uint32 idx, CVolume volume, SuccessCb? cb = null);
  851. public Operation? set_sink_input_mute(uint32 idx, bool mute, SuccessCb? cb = null);
  852. public Operation? kill_sink_input(uint32 idx, SuccessCb? cb = null);
  853. public Operation? get_source_output_info(uint32 idx, SourceOutputInfoCb cb);
  854. public Operation? get_source_output_info_list(SourceOutputInfoCb cb);
  855. public Operation? move_source_output_by_index(uint32 idx, uint32 source_idx, SuccessCb? cb = null);
  856. public Operation? move_source_output_by_name(uint32 idx, string source_name, SuccessCb? cb = null);
  857. public Operation? kill_source_output(uint32 idx, SuccessCb? cb = null);
  858. public Operation? stat(StatInfoCb cb);
  859. public Operation? get_sample_info_by_name(string name, SampleInfoCb cb);
  860. public Operation? get_sample_info_by_index(uint32 idx, SampleInfoCb cb);
  861. public Operation? get_sample_info_list(SampleInfoCb cb);
  862. public Operation? remove_sample(string name, SuccessCb? cb = null);
  863. public Operation? play_sample(string name, string? device = null, Volume volume = Volume.INVALID, SuccessCb? cb = null);
  864. public Operation? play_sample_with_proplist(string name, string? device = null, Volume volume = Volume.INVALID, Proplist? p = null, IndexCb? cb = null);
  865. }
  866. [Compact]
  867. [CCode (cname="pa_stream", cprefix="pa_stream_", unref_function="pa_stream_unref", ref_function="pa_stream_ref", has_type_id=false)]
  868. public class Stream {
  869. [CCode (cname="pa_stream_flags_t", cprefix="PA_STREAM_", has_type_id=false)]
  870. public enum Flags {
  871. START_CORKED,
  872. INTERPOLATE_TIMING,
  873. NOT_MONOTONIC,
  874. AUTO_TIMING_UPDATE,
  875. NO_REMAP_CHANNELS,
  876. NO_REMIX_CHANNELS,
  877. FIX_FORMAT,
  878. FIX_RATE,
  879. FIX_CHANNELS,
  880. DONT_MOVE,
  881. VARIABLE_RATE,
  882. PEAK_DETECT,
  883. START_MUTED,
  884. ADJUST_LATENCY,
  885. EARLY_REQUESTS,
  886. DONT_INHIBIT_AUTO_SUSPEND,
  887. START_UNMUTED,
  888. FAIL_ON_SUSPEND
  889. }
  890. [CCode (cname="pa_stream_state_t", cprefix="PA_STREAM_", has_type_id=false)]
  891. public enum State {
  892. UNCONNECTED,
  893. CREATING,
  894. READY,
  895. FAILED,
  896. TERMINATED;
  897. [CCode (cname="PA_STREAM_IS_GOOD")]
  898. public bool IS_GOOD();
  899. }
  900. [CCode (cname="pa_stream_direction_t", cprefix="PA_STREAM_", has_type_id=false)]
  901. public enum Direction {
  902. NODIRECTION,
  903. PLAYBACK,
  904. RECORD,
  905. UPLOAD
  906. }
  907. [CCode (cname="pa_seek_mode_t", cprefix="PA_SEEK_", has_type_id=false)]
  908. public enum SeekMode {
  909. RELATIVE,
  910. ABSOLUTE,
  911. RELATIVE_ON_READ,
  912. RELATIVE_END
  913. }
  914. [CCode (cname="pa_buffer_attr", has_type_id=false)]
  915. public struct BufferAttr {
  916. uint32 maxlength;
  917. uint32 tlength;
  918. uint32 prebuf;
  919. uint32 minreq;
  920. uint32 fragsize;
  921. }
  922. [CCode (cname="pa_timing_info", has_type_id=false)]
  923. public struct TimingInfo {
  924. timeval timestamp;
  925. int synchronized_clocks;
  926. usec sink_usec;
  927. usec source_usec;
  928. usec transport_usec;
  929. int playing;
  930. int write_index_corrupt;
  931. int64 write_index;
  932. int read_index_corrupt;
  933. int64 read_index;
  934. usec configured_sink_usec;
  935. usec configured_source_usec;
  936. int64 since_underrun;
  937. }
  938. [CCode (cname="PA_STREAM_EVENT_REQUEST_CORK")]
  939. public const string EVENT_REQUEST_CORK;
  940. [CCode (cname="PA_STREAM_EVENT_REQUEST_UNCORK")]
  941. public const string EVENT_REQUEST_UNCORK;
  942. public delegate void SuccessCb(Stream s, int success);
  943. public delegate void RequestCb(Stream s, size_t nbytes);
  944. public delegate void NotifyCb(Stream s);
  945. public delegate void EventCb(Stream s, string name, Proplist proplist);
  946. [CCode (cname="pa_stream_new_with_proplist")]
  947. public Stream(Context c, string name, SampleSpec ss, ChannelMap? map = null, Proplist? proplist = null);
  948. public State get_state();
  949. public Context get_context();
  950. public uint32 get_index();
  951. public uint32 get_device_index();
  952. public unowned string? get_device_name();
  953. public int is_suspended();
  954. public int is_corked();
  955. public int connect_playback(string? dev = null, BufferAttr? a = null, Flags flags = 0, CVolume? volume = null, Stream? sync_stream = null);
  956. public int connect_record(string? dev = null, BufferAttr? a = null, Flags flags = 0);
  957. public int connect_upload(size_t length);
  958. public int disconnect();
  959. public int finish_upload();
  960. public int begin_write(out void* data, out size_t nbytes);
  961. public int cancel_write();
  962. public int write(void *data, size_t bytes, FreeCb? free_cb = null, int64 offset = 0, SeekMode mode = SeekMode.RELATIVE);
  963. public int peek(out void *data, out size_t nbytes);
  964. public int drop();
  965. public size_t writable_size();
  966. public size_t readable_size();
  967. public void set_state_callback(NotifyCb? cb = null);
  968. public void set_write_callback(RequestCb? cb = null);
  969. public void set_read_callback(RequestCb? cb = null);
  970. public void set_overflow_callback(NotifyCb? cb = null);
  971. public void set_underflow_callback(NotifyCb? cb = null);
  972. public void set_started_callback(NotifyCb? cb = null);
  973. public void set_latency_update_callback(NotifyCb? cb = null);
  974. public void set_moved_callback(NotifyCb? cb = null);
  975. public void set_suspended_callback(NotifyCb? cb = null);
  976. public void set_event_callback(EventCb? cb = null);
  977. public void set_buffer_attr_callback(NotifyCb? cb = null);
  978. public Operation? drain(SuccessCb? cb = null);
  979. public Operation? update_timing_info(SuccessCb? cb = null);
  980. public Operation? cork(bool b, SuccessCb? cb = null);
  981. public Operation? flush(SuccessCb? cb = null);
  982. public Operation? prebuf(SuccessCb? cb = null);
  983. public Operation? trigger(SuccessCb? cb = null);
  984. public Operation? set_name(string name, SuccessCb? cb = null);
  985. public Operation? set_buffer_attr(BufferAttr attr, SuccessCb? cb = null);
  986. public Operation? update_sample_rate(uint32 rate, SuccessCb? cb = null);
  987. [CCode (array_length = false)]
  988. public Operation? proplist_remove(string[] keys, SuccessCb? cb = null);
  989. public Operation? proplist_update(UpdateMode mode, Proplist pl, SuccessCb? cb = null);
  990. public unowned TimingInfo? get_timing_info();
  991. public int get_time(out usec u);
  992. public int get_latency(out usec u, out bool negative = null);
  993. public unowned SampleSpec? get_sample_spec();
  994. public unowned ChannelMap? get_channel_map();
  995. public unowned BufferAttr? get_buffer_attr();
  996. public int set_monitor_stream(uint32 sink_input);
  997. public uint32 get_monitor_stream();
  998. }
  999. [CCode (cname="pa_sink_port_info", has_type_id=false)]
  1000. public struct SinkPortInfo {
  1001. public string name;
  1002. public string description;
  1003. public uint32 priority;
  1004. }
  1005. [CCode (cname="pa_sink_info", has_type_id=false)]
  1006. public struct SinkInfo {
  1007. public string name;
  1008. public uint32 index;
  1009. public string description;
  1010. public SampleSpec sample_spec;
  1011. public ChannelMap channel_map;
  1012. public uint32 owner_module;
  1013. public CVolume volume;
  1014. public int mute;
  1015. public uint32 monitor_source;
  1016. public string monitor_source_name;
  1017. public usec latency;
  1018. public string driver;
  1019. public SinkFlags flags;
  1020. public Proplist proplist;
  1021. public usec configured_latency;
  1022. public Volume base_volume;
  1023. public SinkState state;
  1024. public uint32 n_volume_steps;
  1025. public uint32 card;
  1026. public uint32 n_ports;
  1027. public SinkPortInfo*[] ports;
  1028. public SinkPortInfo* active_port;
  1029. }
  1030. [CCode (cname="pa_source_port_info", has_type_id=false)]
  1031. public struct SourcePortInfo {
  1032. public string name;
  1033. public string description;
  1034. public uint32 priority;
  1035. }
  1036. [CCode (cname="pa_source_info", has_type_id=false)]
  1037. public struct SourceInfo {
  1038. public string name;
  1039. public uint32 index;
  1040. public string description;
  1041. public SampleSpec sample_spec;
  1042. public ChannelMap channel_map;
  1043. public uint32 owner_module;
  1044. public CVolume volume;
  1045. public int mute;
  1046. public uint32 monitor_of_sink;
  1047. public string monitor_of_sink_name;
  1048. public usec latency;
  1049. public string driver;
  1050. public SourceFlags flags;
  1051. public Proplist proplist;
  1052. public usec configured_latency;
  1053. public Volume base_volume;
  1054. public SourceState state;
  1055. public uint32 n_volume_steps;
  1056. public uint32 card;
  1057. public uint32 n_ports;
  1058. public SourcePortInfo*[] ports;
  1059. public SourcePortInfo* active_port;
  1060. }
  1061. [CCode (cname="pa_server_info", has_type_id=false)]
  1062. public struct ServerInfo {
  1063. public string user_name;
  1064. public string host_name;
  1065. public string server_version;
  1066. public string server_name;
  1067. public SampleSpec sample_spec;
  1068. public string default_sink_name;
  1069. public string default_source_name;
  1070. public ChannelMap channel_map;
  1071. }
  1072. [CCode (cname="pa_module_info", has_type_id=false)]
  1073. public struct ModuleInfo {
  1074. public uint32 index;
  1075. public string name;
  1076. public string argument;
  1077. public uint32 n_used;
  1078. public Proplist proplist;
  1079. }
  1080. [CCode (cname="pa_client_info", has_type_id=false)]
  1081. public struct ClientInfo {
  1082. public uint32 index;
  1083. public string name;
  1084. public uint32 owner_module;
  1085. public string driver;
  1086. public Proplist proplist;
  1087. }
  1088. [CCode (cname="pa_card_profile_info", has_type_id=false)]
  1089. public struct CardProfileInfo {
  1090. public string name;
  1091. public string description;
  1092. public uint32 n_sinks;
  1093. public uint32 n_sources;
  1094. public uint32 priority;
  1095. }
  1096. [CCode (cname="pa_card_info", has_type_id=false)]
  1097. public struct CardInfo {
  1098. public uint32 index;
  1099. public string name;
  1100. public uint32 owner_module;
  1101. public string driver;
  1102. public uint32 n_profiles;
  1103. public CardProfileInfo[] profiles;
  1104. public CardProfileInfo *active_profile;
  1105. public Proplist proplist;
  1106. }
  1107. [CCode (cname="pa_sink_input_info", has_type_id=false)]
  1108. public struct SinkInputInfo {
  1109. public uint32 index;
  1110. public string name;
  1111. public uint32 owner_module;
  1112. public uint32 client;
  1113. public uint32 sink;
  1114. public SampleSpec sample_spec;
  1115. public ChannelMap channel_map;
  1116. public CVolume volume;
  1117. public uint32 buffer_usec;
  1118. public uint32 sink_usec;
  1119. public string resample_method;
  1120. public string driver;
  1121. public int mute;
  1122. public Proplist proplist;
  1123. public int corked;
  1124. public int has_volume;
  1125. public int volume_writable;
  1126. }
  1127. [CCode (cname="pa_source_output_info", has_type_id=false)]
  1128. public struct SourceOutputInfo {
  1129. public uint32 index;
  1130. public string name;
  1131. public uint32 owner_module;
  1132. public uint32 client;
  1133. public uint32 source;
  1134. public SampleSpec sample_spec;
  1135. public ChannelMap channel_map;
  1136. public uint32 buffer_usec;
  1137. public uint32 sink_usec;
  1138. public string resample_method;
  1139. public string driver;
  1140. public Proplist proplist;
  1141. public int corked;
  1142. public CVolume volume;
  1143. public int mute;
  1144. public int has_volume;
  1145. public int volume_writable;
  1146. }
  1147. [CCode (cname="pa_stat_info", has_type_id=false)]
  1148. public struct StatInfo {
  1149. public uint32 memblock_total;
  1150. public uint32 memblock_total_size;
  1151. public uint32 memblock_allocated;
  1152. public uint32 memblock_allocated_size;
  1153. public uint32 scache_size;
  1154. }
  1155. [CCode (cname="pa_sample_info", has_type_id=false)]
  1156. public struct SampleInfo {
  1157. public uint32 index;
  1158. public string name;
  1159. public CVolume volume;
  1160. public SampleSpec sample_spec;
  1161. public ChannelMap channel_map;
  1162. public usec duration;
  1163. public uint32 bytes;
  1164. public bool lazy;
  1165. public string filename;
  1166. public Proplist proplist;
  1167. }
  1168. [CCode (cname="pa_sink_flags_t", cprefix="PA_SINK_", has_type_id=false)]
  1169. public enum SinkFlags {
  1170. HW_VOLUME_CTRL,
  1171. LATENCY,
  1172. HARDWARE,
  1173. NETWORK,
  1174. HW_MUTE_CTRL,
  1175. DECIBEL_VOLUME,
  1176. FLAT_VOLUME,
  1177. DYNAMIC_LATENCY
  1178. }
  1179. [CCode (cname="pa_source_flags_t", cprefix="PA_SOURCE_", has_type_id=false)]
  1180. public enum SourceFlags {
  1181. HW_VOLUME_CTRL,
  1182. LATENCY,
  1183. HARDWARE,
  1184. NETWORK,
  1185. HW_MUTE_CTRL,
  1186. DECIBEL_VOLUME,
  1187. DYNAMIC_LATENCY
  1188. }
  1189. [CCode (cname="pa_sink_state_t", cprefix="PA_SINK_", has_type_id=false)]
  1190. public enum SinkState {
  1191. INVALID_STATE,
  1192. RUNNING,
  1193. IDLE,
  1194. SUSPENDED;
  1195. [CCode (cname="PA_SINK_IS_OPENED")]
  1196. public bool IS_OPENED();
  1197. }
  1198. [CCode (cname="pa_source_state_t", cprefix="PA_SOURCE_", has_type_id=false)]
  1199. public enum SourceState {
  1200. INVALID_STATE,
  1201. RUNNING,
  1202. IDLE,
  1203. SUSPENDED;
  1204. [CCode (cname="PA_SOURCE_IS_OPENED")]
  1205. public bool IS_OPENED();
  1206. }
  1207. [CCode (cname="pa_gettimeofday")]
  1208. public unowned timeval gettimeofday(out timeval tv);
  1209. [CCode (cname="pa_timeval_diff")]
  1210. public usec timeval_diff(ref timeval a, ref timeval b);
  1211. [CCode (cname="pa_timeval_cmp")]
  1212. public int timeval_cmp(ref timeval a, ref timeval b);
  1213. [CCode (cname="pa_timeval_age")]
  1214. public usec timeval_age(ref timeval a);
  1215. [CCode (cname="pa_timeval_add")]
  1216. public unowned timeval timeval_add(ref timeval tv, usec x);
  1217. [CCode (cname="pa_timeval_sub")]
  1218. public unowned timeval timeval_sub(ref timeval tv, usec x);
  1219. [CCode (cname="pa_timeval_store")]
  1220. public unowned timeval timeval_store(out timeval tv, usec c);
  1221. [CCode (cname="pa_timeval_load")]
  1222. public usec timeval_load(timeval tv);
  1223. [CCode (cname="PA_USEC_MAX")]
  1224. public const usec USEC_MAX;
  1225. [CCode (cname="PA_USEC_INVALID")]
  1226. public const usec USEC_INVALID;
  1227. [CCode (cname="PA_MSEC_PER_SEC")]
  1228. public const usec MSEC_PER_SEC;
  1229. [CCode (cname="PA_USEC_PER_SEC")]
  1230. public const usec USEC_PER_SEC;
  1231. [CCode (cname="PA_NSEC_PER_SEC")]
  1232. public const uint64 NSEC_PER_SEC;
  1233. [CCode (cname="PA_USEC_PER_MSEC")]
  1234. public const usec USEC_PER_MSEC;
  1235. [CCode (cname="PA_NSEC_PER_MSEC")]
  1236. public const uint64 NSEC_PER_MSEC;
  1237. [CCode (cname="PA_NSEC_PER_USEC")]
  1238. public const uint64 NSEC_PER_USEC;
  1239. }