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