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