1 module pulse.def; 2 3 version(linux): 4 5 import core.sys.posix.sys.select; 6 7 import pulse.sample; 8 9 extern (C): 10 11 /*** 12 This file is part of PulseAudio. 13 14 Copyright 2004-2006 Lennart Poettering 15 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB 16 17 PulseAudio is free software; you can redistribute it and/or modify 18 it under the terms of the GNU Lesser General Public License as 19 published by the Free Software Foundation; either version 2.1 of the 20 License, or (at your option) any later version. 21 22 PulseAudio is distributed in the hope that it will be useful, but 23 WITHOUT ANY WARRANTY; without even the implied warranty of 24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 Lesser General Public License for more details. 26 27 You should have received a copy of the GNU Lesser General Public 28 License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 29 ***/ 30 31 /** \file 32 * Global definitions */ 33 34 /** The state of a connection context */ 35 enum pa_context_state 36 { 37 PA_CONTEXT_UNCONNECTED = 0, /**< The context hasn't been connected yet */ 38 PA_CONTEXT_CONNECTING = 1, /**< A connection is being established */ 39 PA_CONTEXT_AUTHORIZING = 2, /**< The client is authorizing itself to the daemon */ 40 PA_CONTEXT_SETTING_NAME = 3, /**< The client is passing its application name to the daemon */ 41 PA_CONTEXT_READY = 4, /**< The connection is established, the context is ready to execute operations */ 42 PA_CONTEXT_FAILED = 5, /**< The connection failed or was disconnected */ 43 PA_CONTEXT_TERMINATED = 6 /**< The connection was terminated cleanly */ 44 } 45 46 alias pa_context_state_t = pa_context_state; 47 48 /** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */ 49 int PA_CONTEXT_IS_GOOD (pa_context_state_t x); 50 51 /** \cond fulldocs */ 52 enum PA_CONTEXT_UNCONNECTED = pa_context_state_t.PA_CONTEXT_UNCONNECTED; 53 enum PA_CONTEXT_CONNECTING = pa_context_state_t.PA_CONTEXT_CONNECTING; 54 enum PA_CONTEXT_AUTHORIZING = pa_context_state_t.PA_CONTEXT_AUTHORIZING; 55 enum PA_CONTEXT_SETTING_NAME = pa_context_state_t.PA_CONTEXT_SETTING_NAME; 56 enum PA_CONTEXT_READY = pa_context_state_t.PA_CONTEXT_READY; 57 enum PA_CONTEXT_FAILED = pa_context_state_t.PA_CONTEXT_FAILED; 58 enum PA_CONTEXT_TERMINATED = pa_context_state_t.PA_CONTEXT_TERMINATED; 59 // enum PA_CONTEXT_IS_GOOD = PA_CONTEXT_IS_GOOD; 60 /** \endcond */ 61 62 /** The state of a stream */ 63 enum pa_stream_state 64 { 65 PA_STREAM_UNCONNECTED = 0, /**< The stream is not yet connected to any sink or source */ 66 PA_STREAM_CREATING = 1, /**< The stream is being created */ 67 PA_STREAM_READY = 2, /**< The stream is established, you may pass audio data to it now */ 68 PA_STREAM_FAILED = 3, /**< An error occurred that made the stream invalid */ 69 PA_STREAM_TERMINATED = 4 /**< The stream has been terminated cleanly */ 70 } 71 72 alias pa_stream_state_t = pa_stream_state; 73 74 /** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */ 75 int PA_STREAM_IS_GOOD (pa_stream_state_t x); 76 77 /** \cond fulldocs */ 78 enum PA_STREAM_UNCONNECTED = pa_stream_state_t.PA_STREAM_UNCONNECTED; 79 enum PA_STREAM_CREATING = pa_stream_state_t.PA_STREAM_CREATING; 80 enum PA_STREAM_READY = pa_stream_state_t.PA_STREAM_READY; 81 enum PA_STREAM_FAILED = pa_stream_state_t.PA_STREAM_FAILED; 82 enum PA_STREAM_TERMINATED = pa_stream_state_t.PA_STREAM_TERMINATED; 83 // enum PA_STREAM_IS_GOOD = PA_STREAM_IS_GOOD; 84 /** \endcond */ 85 86 /** The state of an operation */ 87 enum pa_operation_state 88 { 89 PA_OPERATION_RUNNING = 0, 90 /**< The operation is still running */ 91 PA_OPERATION_DONE = 1, 92 /**< The operation has completed */ 93 PA_OPERATION_CANCELLED = 2 94 /**< The operation has been cancelled. Operations may get cancelled by the 95 * application, or as a result of the context getting disconnected while the 96 * operation is pending. */ 97 } 98 99 alias pa_operation_state_t = pa_operation_state; 100 101 /** \cond fulldocs */ 102 enum PA_OPERATION_RUNNING = pa_operation_state_t.PA_OPERATION_RUNNING; 103 enum PA_OPERATION_DONE = pa_operation_state_t.PA_OPERATION_DONE; 104 enum PA_OPERATION_CANCELED = pa_operation_state_t.PA_OPERATION_CANCELLED; 105 enum PA_OPERATION_CANCELLED = pa_operation_state_t.PA_OPERATION_CANCELLED; 106 /** \endcond */ 107 108 /** An invalid index */ 109 enum PA_INVALID_INDEX = cast(uint) -1; 110 111 /** Some special flags for contexts. */ 112 enum pa_context_flags 113 { 114 PA_CONTEXT_NOFLAGS = 0x0000U, 115 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 116 PA_CONTEXT_NOAUTOSPAWN = 0x0001U, 117 /**< Disabled autospawning of the PulseAudio daemon if required */ 118 PA_CONTEXT_NOFAIL = 0x0002U 119 /**< Don't fail if the daemon is not available when pa_context_connect() is 120 * called, instead enter PA_CONTEXT_CONNECTING state and wait for the daemon 121 * to appear. \since 0.9.15 */ 122 } 123 124 alias pa_context_flags_t = pa_context_flags; 125 126 /** \cond fulldocs */ 127 /* Allow clients to check with #ifdef for those flags */ 128 enum PA_CONTEXT_NOAUTOSPAWN = pa_context_flags_t.PA_CONTEXT_NOAUTOSPAWN; 129 enum PA_CONTEXT_NOFAIL = pa_context_flags_t.PA_CONTEXT_NOFAIL; 130 /** \endcond */ 131 132 /** Direction bitfield - while we currently do not expose anything bidirectional, 133 one should test against the bit instead of the value (e.g.\ if (d & PA_DIRECTION_OUTPUT)), 134 because we might add bidirectional stuff in the future. \since 2.0 135 */ 136 enum pa_direction 137 { 138 PA_DIRECTION_OUTPUT = 0x0001U, /**< Output direction */ 139 PA_DIRECTION_INPUT = 0x0002U /**< Input direction */ 140 } 141 142 alias pa_direction_t = pa_direction; 143 144 /** \cond fulldocs */ 145 enum PA_DIRECTION_OUTPUT = pa_direction_t.PA_DIRECTION_OUTPUT; 146 enum PA_DIRECTION_INPUT = pa_direction_t.PA_DIRECTION_INPUT; 147 /** \endcond */ 148 149 /** The type of device we are dealing with */ 150 enum pa_device_type 151 { 152 PA_DEVICE_TYPE_SINK = 0, /**< Playback device */ 153 PA_DEVICE_TYPE_SOURCE = 1 /**< Recording device */ 154 } 155 156 alias pa_device_type_t = pa_device_type; 157 158 /** \cond fulldocs */ 159 enum PA_DEVICE_TYPE_SINK = pa_device_type_t.PA_DEVICE_TYPE_SINK; 160 enum PA_DEVICE_TYPE_SOURCE = pa_device_type_t.PA_DEVICE_TYPE_SOURCE; 161 /** \endcond */ 162 163 /** The direction of a pa_stream object */ 164 enum pa_stream_direction 165 { 166 PA_STREAM_NODIRECTION = 0, /**< Invalid direction */ 167 PA_STREAM_PLAYBACK = 1, /**< Playback stream */ 168 PA_STREAM_RECORD = 2, /**< Record stream */ 169 PA_STREAM_UPLOAD = 3 /**< Sample upload stream */ 170 } 171 172 alias pa_stream_direction_t = pa_stream_direction; 173 174 /** \cond fulldocs */ 175 enum PA_STREAM_NODIRECTION = pa_stream_direction_t.PA_STREAM_NODIRECTION; 176 enum PA_STREAM_PLAYBACK = pa_stream_direction_t.PA_STREAM_PLAYBACK; 177 enum PA_STREAM_RECORD = pa_stream_direction_t.PA_STREAM_RECORD; 178 enum PA_STREAM_UPLOAD = pa_stream_direction_t.PA_STREAM_UPLOAD; 179 /** \endcond */ 180 181 /** Some special flags for stream connections. */ 182 enum pa_stream_flags 183 { 184 PA_STREAM_NOFLAGS = 0x0000U, 185 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 186 187 PA_STREAM_START_CORKED = 0x0001U, 188 /**< Create the stream corked, requiring an explicit 189 * pa_stream_cork() call to uncork it. */ 190 191 PA_STREAM_INTERPOLATE_TIMING = 0x0002U, 192 /**< Interpolate the latency for this stream. When enabled, 193 * pa_stream_get_latency() and pa_stream_get_time() will try to 194 * estimate the current record/playback time based on the local 195 * time that passed since the last timing info update. Using this 196 * option has the advantage of not requiring a whole roundtrip 197 * when the current playback/recording time is needed. Consider 198 * using this option when requesting latency information 199 * frequently. This is especially useful on long latency network 200 * connections. It makes a lot of sense to combine this option 201 * with PA_STREAM_AUTO_TIMING_UPDATE. */ 202 203 PA_STREAM_NOT_MONOTONIC = 0x0004U, 204 /**< Don't force the time to increase monotonically. If this 205 * option is enabled, pa_stream_get_time() will not necessarily 206 * return always monotonically increasing time values on each 207 * call. This may confuse applications which cannot deal with time 208 * going 'backwards', but has the advantage that bad transport 209 * latency estimations that caused the time to jump ahead can 210 * be corrected quickly, without the need to wait. (Please note 211 * that this flag was named PA_STREAM_NOT_MONOTONOUS in releases 212 * prior to 0.9.11. The old name is still defined too, for 213 * compatibility reasons. */ 214 215 PA_STREAM_AUTO_TIMING_UPDATE = 0x0008U, 216 /**< If set timing update requests are issued periodically 217 * automatically. Combined with PA_STREAM_INTERPOLATE_TIMING you 218 * will be able to query the current time and latency with 219 * pa_stream_get_time() and pa_stream_get_latency() at all times 220 * without a packet round trip.*/ 221 222 PA_STREAM_NO_REMAP_CHANNELS = 0x0010U, 223 /**< Don't remap channels by their name, instead map them simply 224 * by their index. Implies PA_STREAM_NO_REMIX_CHANNELS. Only 225 * supported when the server is at least PA 0.9.8. It is ignored 226 * on older servers.\since 0.9.8 */ 227 228 PA_STREAM_NO_REMIX_CHANNELS = 0x0020U, 229 /**< When remapping channels by name, don't upmix or downmix them 230 * to related channels. Copy them into matching channels of the 231 * device 1:1. Only supported when the server is at least PA 232 * 0.9.8. It is ignored on older servers. \since 0.9.8 */ 233 234 PA_STREAM_FIX_FORMAT = 0x0040U, 235 /**< Use the sample format of the sink/device this stream is being 236 * connected to, and possibly ignore the format the sample spec 237 * contains -- but you still have to pass a valid value in it as a 238 * hint to PulseAudio what would suit your stream best. If this is 239 * used you should query the used sample format after creating the 240 * stream by using pa_stream_get_sample_spec(). Also, if you 241 * specified manual buffer metrics it is recommended to update 242 * them with pa_stream_set_buffer_attr() to compensate for the 243 * changed frame sizes. Only supported when the server is at least 244 * PA 0.9.8. It is ignored on older servers. 245 * 246 * When creating streams with pa_stream_new_extended(), this flag has no 247 * effect. If you specify a format with PCM encoding, and you want the 248 * server to choose the sample format, then you should leave the sample 249 * format unspecified in the pa_format_info object. This also means that 250 * you can't use pa_format_info_from_sample_spec(), because that function 251 * always sets the sample format. 252 * 253 * \since 0.9.8 */ 254 255 PA_STREAM_FIX_RATE = 0x0080U, 256 /**< Use the sample rate of the sink, and possibly ignore the rate 257 * the sample spec contains. Usage similar to 258 * PA_STREAM_FIX_FORMAT. Only supported when the server is at least 259 * PA 0.9.8. It is ignored on older servers. 260 * 261 * When creating streams with pa_stream_new_extended(), this flag has no 262 * effect. If you specify a format with PCM encoding, and you want the 263 * server to choose the sample rate, then you should leave the rate 264 * unspecified in the pa_format_info object. This also means that you can't 265 * use pa_format_info_from_sample_spec(), because that function always sets 266 * the sample rate. 267 * 268 * \since 0.9.8 */ 269 270 PA_STREAM_FIX_CHANNELS = 0x0100, 271 /**< Use the number of channels and the channel map of the sink, 272 * and possibly ignore the number of channels and the map the 273 * sample spec and the passed channel map contain. Usage similar 274 * to PA_STREAM_FIX_FORMAT. Only supported when the server is at 275 * least PA 0.9.8. It is ignored on older servers. 276 * 277 * When creating streams with pa_stream_new_extended(), this flag has no 278 * effect. If you specify a format with PCM encoding, and you want the 279 * server to choose the channel count and/or channel map, then you should 280 * leave the channels and/or the channel map unspecified in the 281 * pa_format_info object. This also means that you can't use 282 * pa_format_info_from_sample_spec(), because that function always sets 283 * the channel count (but if you only want to leave the channel map 284 * unspecified, then pa_format_info_from_sample_spec() works, because it 285 * accepts a NULL channel map). 286 * 287 * \since 0.9.8 */ 288 289 PA_STREAM_DONT_MOVE = 0x0200U, 290 /**< Don't allow moving of this stream to another 291 * sink/device. Useful if you use any of the PA_STREAM_FIX_ flags 292 * and want to make sure that resampling never takes place -- 293 * which might happen if the stream is moved to another 294 * sink/source with a different sample spec/channel map. Only 295 * supported when the server is at least PA 0.9.8. It is ignored 296 * on older servers. \since 0.9.8 */ 297 298 PA_STREAM_VARIABLE_RATE = 0x0400U, 299 /**< Allow dynamic changing of the sampling rate during playback 300 * with pa_stream_update_sample_rate(). Only supported when the 301 * server is at least PA 0.9.8. It is ignored on older 302 * servers. \since 0.9.8 */ 303 304 PA_STREAM_PEAK_DETECT = 0x0800U, 305 /**< Find peaks instead of resampling. \since 0.9.11 */ 306 307 PA_STREAM_START_MUTED = 0x1000U, 308 /**< Create in muted state. If neither PA_STREAM_START_UNMUTED nor 309 * PA_STREAM_START_MUTED are set, it is left to the server to decide 310 * whether to create the stream in muted or in unmuted 311 * state. \since 0.9.11 */ 312 313 PA_STREAM_ADJUST_LATENCY = 0x2000U, 314 /**< Try to adjust the latency of the sink/source based on the 315 * requested buffer metrics and adjust buffer metrics 316 * accordingly. Also see pa_buffer_attr. This option may not be 317 * specified at the same time as PA_STREAM_EARLY_REQUESTS. \since 318 * 0.9.11 */ 319 320 PA_STREAM_EARLY_REQUESTS = 0x4000U, 321 /**< Enable compatibility mode for legacy clients that rely on a 322 * "classic" hardware device fragment-style playback model. If 323 * this option is set, the minreq value of the buffer metrics gets 324 * a new meaning: instead of just specifying that no requests 325 * asking for less new data than this value will be made to the 326 * client it will also guarantee that requests are generated as 327 * early as this limit is reached. This flag should only be set in 328 * very few situations where compatibility with a fragment-based 329 * playback model needs to be kept and the client applications 330 * cannot deal with data requests that are delayed to the latest 331 * moment possible. (Usually these are programs that use usleep() 332 * or a similar call in their playback loops instead of sleeping 333 * on the device itself.) Also see pa_buffer_attr. This option may 334 * not be specified at the same time as 335 * PA_STREAM_ADJUST_LATENCY. \since 0.9.12 */ 336 337 PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND = 0x8000U, 338 /**< If set this stream won't be taken into account when it is 339 * checked whether the device this stream is connected to should 340 * auto-suspend. \since 0.9.15 */ 341 342 PA_STREAM_START_UNMUTED = 0x10000U, 343 /**< Create in unmuted state. If neither PA_STREAM_START_UNMUTED 344 * nor PA_STREAM_START_MUTED are set it is left to the server to decide 345 * whether to create the stream in muted or in unmuted 346 * state. \since 0.9.15 */ 347 348 PA_STREAM_FAIL_ON_SUSPEND = 0x20000U, 349 /**< If the sink/source this stream is connected to is suspended 350 * during the creation of this stream, cause it to fail. If the 351 * sink/source is being suspended during creation of this stream, 352 * make sure this stream is terminated. \since 0.9.15 */ 353 354 PA_STREAM_RELATIVE_VOLUME = 0x40000U, 355 /**< If a volume is passed when this stream is created, consider 356 * it relative to the sink's current volume, never as absolute 357 * device volume. If this is not specified the volume will be 358 * consider absolute when the sink is in flat volume mode, 359 * relative otherwise. \since 0.9.20 */ 360 361 PA_STREAM_PASSTHROUGH = 0x80000U 362 /**< Used to tag content that will be rendered by passthrough sinks. 363 * The data will be left as is and not reformatted, resampled. 364 * \since 1.0 */ 365 } 366 367 alias pa_stream_flags_t = pa_stream_flags; 368 369 /** \cond fulldocs */ 370 371 /* English is an evil language */ 372 enum PA_STREAM_NOT_MONOTONOUS = pa_stream_flags_t.PA_STREAM_NOT_MONOTONIC; 373 374 /* Allow clients to check with #ifdef for those flags */ 375 enum PA_STREAM_START_CORKED = pa_stream_flags_t.PA_STREAM_START_CORKED; 376 enum PA_STREAM_INTERPOLATE_TIMING = pa_stream_flags_t.PA_STREAM_INTERPOLATE_TIMING; 377 enum PA_STREAM_NOT_MONOTONIC = pa_stream_flags_t.PA_STREAM_NOT_MONOTONIC; 378 enum PA_STREAM_AUTO_TIMING_UPDATE = pa_stream_flags_t.PA_STREAM_AUTO_TIMING_UPDATE; 379 enum PA_STREAM_NO_REMAP_CHANNELS = pa_stream_flags_t.PA_STREAM_NO_REMAP_CHANNELS; 380 enum PA_STREAM_NO_REMIX_CHANNELS = pa_stream_flags_t.PA_STREAM_NO_REMIX_CHANNELS; 381 enum PA_STREAM_FIX_FORMAT = pa_stream_flags_t.PA_STREAM_FIX_FORMAT; 382 enum PA_STREAM_FIX_RATE = pa_stream_flags_t.PA_STREAM_FIX_RATE; 383 enum PA_STREAM_FIX_CHANNELS = pa_stream_flags_t.PA_STREAM_FIX_CHANNELS; 384 enum PA_STREAM_DONT_MOVE = pa_stream_flags_t.PA_STREAM_DONT_MOVE; 385 enum PA_STREAM_VARIABLE_RATE = pa_stream_flags_t.PA_STREAM_VARIABLE_RATE; 386 enum PA_STREAM_PEAK_DETECT = pa_stream_flags_t.PA_STREAM_PEAK_DETECT; 387 enum PA_STREAM_START_MUTED = pa_stream_flags_t.PA_STREAM_START_MUTED; 388 enum PA_STREAM_ADJUST_LATENCY = pa_stream_flags_t.PA_STREAM_ADJUST_LATENCY; 389 enum PA_STREAM_EARLY_REQUESTS = pa_stream_flags_t.PA_STREAM_EARLY_REQUESTS; 390 enum PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND = pa_stream_flags_t.PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND; 391 enum PA_STREAM_START_UNMUTED = pa_stream_flags_t.PA_STREAM_START_UNMUTED; 392 enum PA_STREAM_FAIL_ON_SUSPEND = pa_stream_flags_t.PA_STREAM_FAIL_ON_SUSPEND; 393 enum PA_STREAM_RELATIVE_VOLUME = pa_stream_flags_t.PA_STREAM_RELATIVE_VOLUME; 394 enum PA_STREAM_PASSTHROUGH = pa_stream_flags_t.PA_STREAM_PASSTHROUGH; 395 396 /** \endcond */ 397 398 /** Playback and record buffer metrics */ 399 struct pa_buffer_attr 400 { 401 uint maxlength; 402 /**< Maximum length of the buffer in bytes. Setting this to (uint32_t) -1 403 * will initialize this to the maximum value supported by server, 404 * which is recommended. 405 * 406 * In strict low-latency playback scenarios you might want to set this to 407 * a lower value, likely together with the PA_STREAM_ADJUST_LATENCY flag. 408 * If you do so, you ensure that the latency doesn't grow beyond what is 409 * acceptable for the use case, at the cost of getting more underruns if 410 * the latency is lower than what the server can reliably handle. */ 411 412 uint tlength; 413 /**< Playback only: target length of the buffer. The server tries 414 * to assure that at least tlength bytes are always available in 415 * the per-stream server-side playback buffer. The server will 416 * only send requests for more data as long as the buffer has 417 * less than this number of bytes of data. 418 * 419 * It is recommended to set this to (uint32_t) -1, which will 420 * initialize this to a value that is deemed sensible by the 421 * server. However, this value will default to something like 2s; 422 * for applications that have specific latency requirements 423 * this value should be set to the maximum latency that the 424 * application can deal with. 425 * 426 * When PA_STREAM_ADJUST_LATENCY is not set this value will 427 * influence only the per-stream playback buffer size. When 428 * PA_STREAM_ADJUST_LATENCY is set the overall latency of the sink 429 * plus the playback buffer size is configured to this value. Set 430 * PA_STREAM_ADJUST_LATENCY if you are interested in adjusting the 431 * overall latency. Don't set it if you are interested in 432 * configuring the server-side per-stream playback buffer 433 * size. */ 434 435 uint prebuf; 436 /**< Playback only: pre-buffering. The server does not start with 437 * playback before at least prebuf bytes are available in the 438 * buffer. It is recommended to set this to (uint32_t) -1, which 439 * will initialize this to the same value as tlength, whatever 440 * that may be. 441 * 442 * Initialize to 0 to enable manual start/stop control of the stream. 443 * This means that playback will not stop on underrun and playback 444 * will not start automatically, instead pa_stream_cork() needs to 445 * be called explicitly. If you set this value to 0 you should also 446 * set PA_STREAM_START_CORKED. Should underrun occur, the read index 447 * of the output buffer overtakes the write index, and hence the 448 * fill level of the buffer is negative. 449 * 450 * Start of playback can be forced using pa_stream_trigger() even 451 * though the prebuffer size hasn't been reached. If a buffer 452 * underrun occurs, this prebuffering will be again enabled. */ 453 454 uint minreq; 455 /**< Playback only: minimum request. The server does not request 456 * less than minreq bytes from the client, instead waits until the 457 * buffer is free enough to request more bytes at once. It is 458 * recommended to set this to (uint32_t) -1, which will initialize 459 * this to a value that is deemed sensible by the server. This 460 * should be set to a value that gives PulseAudio enough time to 461 * move the data from the per-stream playback buffer into the 462 * hardware playback buffer. */ 463 464 uint fragsize; 465 /**< Recording only: fragment size. The server sends data in 466 * blocks of fragsize bytes size. Large values diminish 467 * interactivity with other operations on the connection context 468 * but decrease control overhead. It is recommended to set this to 469 * (uint32_t) -1, which will initialize this to a value that is 470 * deemed sensible by the server. However, this value will default 471 * to something like 2s; For applications that have specific 472 * latency requirements this value should be set to the maximum 473 * latency that the application can deal with. 474 * 475 * If PA_STREAM_ADJUST_LATENCY is set the overall source latency 476 * will be adjusted according to this value. If it is not set the 477 * source latency is left unmodified. */ 478 } 479 480 /** Error values as used by pa_context_errno(). Use pa_strerror() to convert these values to human readable strings */ 481 enum pa_error_code 482 { 483 PA_OK = 0, /**< No error */ 484 PA_ERR_ACCESS = 1, /**< Access failure */ 485 PA_ERR_COMMAND = 2, /**< Unknown command */ 486 PA_ERR_INVALID = 3, /**< Invalid argument */ 487 PA_ERR_EXIST = 4, /**< Entity exists */ 488 PA_ERR_NOENTITY = 5, /**< No such entity */ 489 PA_ERR_CONNECTIONREFUSED = 6, /**< Connection refused */ 490 PA_ERR_PROTOCOL = 7, /**< Protocol error */ 491 PA_ERR_TIMEOUT = 8, /**< Timeout */ 492 PA_ERR_AUTHKEY = 9, /**< No authentication key */ 493 PA_ERR_INTERNAL = 10, /**< Internal error */ 494 PA_ERR_CONNECTIONTERMINATED = 11, /**< Connection terminated */ 495 PA_ERR_KILLED = 12, /**< Entity killed */ 496 PA_ERR_INVALIDSERVER = 13, /**< Invalid server */ 497 PA_ERR_MODINITFAILED = 14, /**< Module initialization failed */ 498 PA_ERR_BADSTATE = 15, /**< Bad state */ 499 PA_ERR_NODATA = 16, /**< No data */ 500 PA_ERR_VERSION = 17, /**< Incompatible protocol version */ 501 PA_ERR_TOOLARGE = 18, /**< Data too large */ 502 PA_ERR_NOTSUPPORTED = 19, /**< Operation not supported \since 0.9.5 */ 503 PA_ERR_UNKNOWN = 20, /**< The error code was unknown to the client */ 504 PA_ERR_NOEXTENSION = 21, /**< Extension does not exist. \since 0.9.12 */ 505 PA_ERR_OBSOLETE = 22, /**< Obsolete functionality. \since 0.9.15 */ 506 PA_ERR_NOTIMPLEMENTED = 23, /**< Missing implementation. \since 0.9.15 */ 507 PA_ERR_FORKED = 24, /**< The caller forked without calling execve() and tried to reuse the context. \since 0.9.15 */ 508 PA_ERR_IO = 25, /**< An IO error happened. \since 0.9.16 */ 509 PA_ERR_BUSY = 26, /**< Device or resource busy. \since 0.9.17 */ 510 PA_ERR_MAX = 27 /**< Not really an error but the first invalid error code */ 511 } 512 513 alias pa_error_code_t = pa_error_code; 514 515 /** \cond fulldocs */ 516 enum PA_OK = pa_error_code_t.PA_OK; 517 enum PA_ERR_ACCESS = pa_error_code_t.PA_ERR_ACCESS; 518 enum PA_ERR_COMMAND = pa_error_code_t.PA_ERR_COMMAND; 519 enum PA_ERR_INVALID = pa_error_code_t.PA_ERR_INVALID; 520 enum PA_ERR_EXIST = pa_error_code_t.PA_ERR_EXIST; 521 enum PA_ERR_NOENTITY = pa_error_code_t.PA_ERR_NOENTITY; 522 enum PA_ERR_CONNECTIONREFUSED = pa_error_code_t.PA_ERR_CONNECTIONREFUSED; 523 enum PA_ERR_PROTOCOL = pa_error_code_t.PA_ERR_PROTOCOL; 524 enum PA_ERR_TIMEOUT = pa_error_code_t.PA_ERR_TIMEOUT; 525 enum PA_ERR_AUTHKEY = pa_error_code_t.PA_ERR_AUTHKEY; 526 enum PA_ERR_INTERNAL = pa_error_code_t.PA_ERR_INTERNAL; 527 enum PA_ERR_CONNECTIONTERMINATED = pa_error_code_t.PA_ERR_CONNECTIONTERMINATED; 528 enum PA_ERR_KILLED = pa_error_code_t.PA_ERR_KILLED; 529 enum PA_ERR_INVALIDSERVER = pa_error_code_t.PA_ERR_INVALIDSERVER; 530 enum PA_ERR_MODINITFAILED = pa_error_code_t.PA_ERR_MODINITFAILED; 531 enum PA_ERR_BADSTATE = pa_error_code_t.PA_ERR_BADSTATE; 532 enum PA_ERR_NODATA = pa_error_code_t.PA_ERR_NODATA; 533 enum PA_ERR_VERSION = pa_error_code_t.PA_ERR_VERSION; 534 enum PA_ERR_TOOLARGE = pa_error_code_t.PA_ERR_TOOLARGE; 535 enum PA_ERR_NOTSUPPORTED = pa_error_code_t.PA_ERR_NOTSUPPORTED; 536 enum PA_ERR_UNKNOWN = pa_error_code_t.PA_ERR_UNKNOWN; 537 enum PA_ERR_NOEXTENSION = pa_error_code_t.PA_ERR_NOEXTENSION; 538 enum PA_ERR_OBSOLETE = pa_error_code_t.PA_ERR_OBSOLETE; 539 enum PA_ERR_NOTIMPLEMENTED = pa_error_code_t.PA_ERR_NOTIMPLEMENTED; 540 enum PA_ERR_FORKED = pa_error_code_t.PA_ERR_FORKED; 541 enum PA_ERR_MAX = pa_error_code_t.PA_ERR_MAX; 542 /** \endcond */ 543 544 /** Subscription event mask, as used by pa_context_subscribe() */ 545 enum pa_subscription_mask 546 { 547 PA_SUBSCRIPTION_MASK_NULL = 0x0000U, 548 /**< No events */ 549 550 PA_SUBSCRIPTION_MASK_SINK = 0x0001U, 551 /**< Sink events */ 552 553 PA_SUBSCRIPTION_MASK_SOURCE = 0x0002U, 554 /**< Source events */ 555 556 PA_SUBSCRIPTION_MASK_SINK_INPUT = 0x0004U, 557 /**< Sink input events */ 558 559 PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 0x0008U, 560 /**< Source output events */ 561 562 PA_SUBSCRIPTION_MASK_MODULE = 0x0010U, 563 /**< Module events */ 564 565 PA_SUBSCRIPTION_MASK_CLIENT = 0x0020U, 566 /**< Client events */ 567 568 PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 0x0040U, 569 /**< Sample cache events */ 570 571 PA_SUBSCRIPTION_MASK_SERVER = 0x0080U, 572 /**< Other global server changes. */ 573 574 /** \cond fulldocs */ 575 PA_SUBSCRIPTION_MASK_AUTOLOAD = 0x0100U, 576 /**< \deprecated Autoload table events. */ 577 /** \endcond */ 578 579 PA_SUBSCRIPTION_MASK_CARD = 0x0200U, 580 /**< Card events. \since 0.9.15 */ 581 582 PA_SUBSCRIPTION_MASK_ALL = 0x02ffU 583 /**< Catch all events */ 584 } 585 586 alias pa_subscription_mask_t = pa_subscription_mask; 587 588 /** Subscription event types, as used by pa_context_subscribe() */ 589 enum pa_subscription_event_type 590 { 591 PA_SUBSCRIPTION_EVENT_SINK = 0x0000U, 592 /**< Event type: Sink */ 593 594 PA_SUBSCRIPTION_EVENT_SOURCE = 0x0001U, 595 /**< Event type: Source */ 596 597 PA_SUBSCRIPTION_EVENT_SINK_INPUT = 0x0002U, 598 /**< Event type: Sink input */ 599 600 PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 0x0003U, 601 /**< Event type: Source output */ 602 603 PA_SUBSCRIPTION_EVENT_MODULE = 0x0004U, 604 /**< Event type: Module */ 605 606 PA_SUBSCRIPTION_EVENT_CLIENT = 0x0005U, 607 /**< Event type: Client */ 608 609 PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 0x0006U, 610 /**< Event type: Sample cache item */ 611 612 PA_SUBSCRIPTION_EVENT_SERVER = 0x0007U, 613 /**< Event type: Global server change, only occurring with PA_SUBSCRIPTION_EVENT_CHANGE. */ 614 615 /** \cond fulldocs */ 616 PA_SUBSCRIPTION_EVENT_AUTOLOAD = 0x0008U, 617 /**< \deprecated Event type: Autoload table changes. */ 618 /** \endcond */ 619 620 PA_SUBSCRIPTION_EVENT_CARD = 0x0009U, 621 /**< Event type: Card \since 0.9.15 */ 622 623 PA_SUBSCRIPTION_EVENT_FACILITY_MASK = 0x000FU, 624 /**< A mask to extract the event type from an event value */ 625 626 PA_SUBSCRIPTION_EVENT_NEW = 0x0000U, 627 /**< A new object was created */ 628 629 PA_SUBSCRIPTION_EVENT_CHANGE = 0x0010U, 630 /**< A property of the object was modified */ 631 632 PA_SUBSCRIPTION_EVENT_REMOVE = 0x0020U, 633 /**< An object was removed */ 634 635 PA_SUBSCRIPTION_EVENT_TYPE_MASK = 0x0030U 636 /**< A mask to extract the event operation from an event value */ 637 } 638 639 alias pa_subscription_event_type_t = pa_subscription_event_type; 640 641 /** Return one if an event type t matches an event mask bitfield */ 642 extern (D) auto pa_subscription_match_flags(T0, T1)(auto ref T0 m, auto ref T1 t) 643 { 644 return !!(m & (1 << (t & pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_FACILITY_MASK))); 645 } 646 647 /** \cond fulldocs */ 648 enum PA_SUBSCRIPTION_MASK_NULL = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_NULL; 649 enum PA_SUBSCRIPTION_MASK_SINK = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_SINK; 650 enum PA_SUBSCRIPTION_MASK_SOURCE = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_SOURCE; 651 enum PA_SUBSCRIPTION_MASK_SINK_INPUT = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_SINK_INPUT; 652 enum PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT; 653 enum PA_SUBSCRIPTION_MASK_MODULE = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_MODULE; 654 enum PA_SUBSCRIPTION_MASK_CLIENT = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_CLIENT; 655 enum PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_SAMPLE_CACHE; 656 enum PA_SUBSCRIPTION_MASK_SERVER = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_SERVER; 657 enum PA_SUBSCRIPTION_MASK_AUTOLOAD = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_AUTOLOAD; 658 enum PA_SUBSCRIPTION_MASK_CARD = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_CARD; 659 enum PA_SUBSCRIPTION_MASK_ALL = pa_subscription_mask_t.PA_SUBSCRIPTION_MASK_ALL; 660 enum PA_SUBSCRIPTION_EVENT_SINK = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_SINK; 661 enum PA_SUBSCRIPTION_EVENT_SOURCE = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_SOURCE; 662 enum PA_SUBSCRIPTION_EVENT_SINK_INPUT = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_SINK_INPUT; 663 enum PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT; 664 enum PA_SUBSCRIPTION_EVENT_MODULE = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_MODULE; 665 enum PA_SUBSCRIPTION_EVENT_CLIENT = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_CLIENT; 666 enum PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE; 667 enum PA_SUBSCRIPTION_EVENT_SERVER = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_SERVER; 668 enum PA_SUBSCRIPTION_EVENT_AUTOLOAD = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_AUTOLOAD; 669 enum PA_SUBSCRIPTION_EVENT_CARD = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_CARD; 670 enum PA_SUBSCRIPTION_EVENT_FACILITY_MASK = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_FACILITY_MASK; 671 enum PA_SUBSCRIPTION_EVENT_NEW = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_NEW; 672 enum PA_SUBSCRIPTION_EVENT_CHANGE = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_CHANGE; 673 enum PA_SUBSCRIPTION_EVENT_REMOVE = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_REMOVE; 674 enum PA_SUBSCRIPTION_EVENT_TYPE_MASK = pa_subscription_event_type_t.PA_SUBSCRIPTION_EVENT_TYPE_MASK; 675 /** \endcond */ 676 677 /** A structure for all kinds of timing information of a stream. See 678 * pa_stream_update_timing_info() and pa_stream_get_timing_info(). The 679 * total output latency a sample that is written with 680 * pa_stream_write() takes to be played may be estimated by 681 * sink_usec+buffer_usec+transport_usec (where buffer_usec is defined 682 * as pa_bytes_to_usec(write_index-read_index)). The output buffer 683 * which buffer_usec relates to may be manipulated freely (with 684 * pa_stream_write()'s seek argument, pa_stream_flush() and friends), 685 * the buffers sink_usec and source_usec relate to are first-in 686 * first-out (FIFO) buffers which cannot be flushed or manipulated in 687 * any way. The total input latency a sample that is recorded takes to 688 * be delivered to the application is: 689 * source_usec+buffer_usec+transport_usec-sink_usec. (Take care of 690 * sign issues!) When connected to a monitor source sink_usec contains 691 * the latency of the owning sink. The two latency estimations 692 * described here are implemented in pa_stream_get_latency(). 693 * 694 * All time values are in the sound card clock domain, unless noted 695 * otherwise. The sound card clock usually runs at a slightly different 696 * rate than the system clock. 697 * 698 * Please note that this structure can be extended as part of evolutionary 699 * API updates at any time in any new release. 700 * */ 701 struct pa_timing_info 702 { 703 timeval timestamp; 704 /**< The system clock time when this timing info structure was 705 * current. */ 706 707 int synchronized_clocks; 708 /**< Non-zero if the local and the remote machine have 709 * synchronized clocks. If synchronized clocks are detected 710 * transport_usec becomes much more reliable. However, the code 711 * that detects synchronized clocks is very limited and unreliable 712 * itself. */ 713 714 pa_usec_t sink_usec; 715 /**< Time in usecs a sample takes to be played on the sink. For 716 * playback streams and record streams connected to a monitor 717 * source. */ 718 719 pa_usec_t source_usec; 720 /**< Time in usecs a sample takes from being recorded to being 721 * delivered to the application. Only for record streams. */ 722 723 pa_usec_t transport_usec; 724 /**< Estimated time in usecs a sample takes to be transferred 725 * to/from the daemon. For both playback and record streams. */ 726 727 int playing; 728 /**< Non-zero when the stream is currently not underrun and data 729 * is being passed on to the device. Only for playback 730 * streams. This field does not say whether the data is actually 731 * already being played. To determine this check whether 732 * since_underrun (converted to usec) is larger than sink_usec.*/ 733 734 int write_index_corrupt; 735 /**< Non-zero if write_index is not up-to-date because a local 736 * write command that corrupted it has been issued in the time 737 * since this latency info was current . Only write commands with 738 * SEEK_RELATIVE_ON_READ and SEEK_RELATIVE_END can corrupt 739 * write_index. */ 740 741 long write_index; 742 /**< Current write index into the playback buffer in bytes. Think 743 * twice before using this for seeking purposes: it might be out 744 * of date at the time you want to use it. Consider using 745 * PA_SEEK_RELATIVE instead. */ 746 747 int read_index_corrupt; 748 /**< Non-zero if read_index is not up-to-date because a local 749 * pause or flush request that corrupted it has been issued in the 750 * time since this latency info was current. */ 751 752 long read_index; 753 /**< Current read index into the playback buffer in bytes. Think 754 * twice before using this for seeking purposes: it might be out 755 * of date at the time you want to use it. Consider using 756 * PA_SEEK_RELATIVE_ON_READ instead. */ 757 758 pa_usec_t configured_sink_usec; 759 /**< The configured latency for the sink. \since 0.9.11 */ 760 761 pa_usec_t configured_source_usec; 762 /**< The configured latency for the source. \since 0.9.11 */ 763 764 long since_underrun; 765 /**< Bytes that were handed to the sink since the last underrun 766 * happened, or since playback started again after the last 767 * underrun. playing will tell you which case it is. \since 768 * 0.9.11 */ 769 } 770 771 /** A structure for the spawn api. This may be used to integrate auto 772 * spawned daemons into your application. For more information see 773 * pa_context_connect(). When spawning a new child process the 774 * waitpid() is used on the child's PID. The spawn routine will not 775 * block or ignore SIGCHLD signals, since this cannot be done in a 776 * thread compatible way. You might have to do this in 777 * prefork/postfork. */ 778 struct pa_spawn_api 779 { 780 void function () prefork; 781 /**< Is called just before the fork in the parent process. May be 782 * NULL. */ 783 784 void function () postfork; 785 /**< Is called immediately after the fork in the parent 786 * process. May be NULL.*/ 787 788 void function () atfork; 789 /**< Is called immediately after the fork in the child 790 * process. May be NULL. It is not safe to close all file 791 * descriptors in this function unconditionally, since a UNIX 792 * socket (created using socketpair()) is passed to the new 793 * process. */ 794 } 795 796 /** Seek type for pa_stream_write(). */ 797 enum pa_seek_mode 798 { 799 PA_SEEK_RELATIVE = 0, 800 /**< Seek relative to the write index. */ 801 802 PA_SEEK_ABSOLUTE = 1, 803 /**< Seek relative to the start of the buffer queue. */ 804 805 PA_SEEK_RELATIVE_ON_READ = 2, 806 /**< Seek relative to the read index. */ 807 808 PA_SEEK_RELATIVE_END = 3 809 /**< Seek relative to the current end of the buffer queue. */ 810 } 811 812 alias pa_seek_mode_t = pa_seek_mode; 813 814 /** \cond fulldocs */ 815 enum PA_SEEK_RELATIVE = pa_seek_mode_t.PA_SEEK_RELATIVE; 816 enum PA_SEEK_ABSOLUTE = pa_seek_mode_t.PA_SEEK_ABSOLUTE; 817 enum PA_SEEK_RELATIVE_ON_READ = pa_seek_mode_t.PA_SEEK_RELATIVE_ON_READ; 818 enum PA_SEEK_RELATIVE_END = pa_seek_mode_t.PA_SEEK_RELATIVE_END; 819 /** \endcond */ 820 821 /** Special sink flags. */ 822 enum pa_sink_flags 823 { 824 PA_SINK_NOFLAGS = 0x0000U, 825 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 826 827 PA_SINK_HW_VOLUME_CTRL = 0x0001U, 828 /**< Supports hardware volume control. This is a dynamic flag and may 829 * change at runtime after the sink has initialized */ 830 831 PA_SINK_LATENCY = 0x0002U, 832 /**< Supports latency querying */ 833 834 PA_SINK_HARDWARE = 0x0004U, 835 /**< Is a hardware sink of some kind, in contrast to 836 * "virtual"/software sinks \since 0.9.3 */ 837 838 PA_SINK_NETWORK = 0x0008U, 839 /**< Is a networked sink of some kind. \since 0.9.7 */ 840 841 PA_SINK_HW_MUTE_CTRL = 0x0010U, 842 /**< Supports hardware mute control. This is a dynamic flag and may 843 * change at runtime after the sink has initialized \since 0.9.11 */ 844 845 PA_SINK_DECIBEL_VOLUME = 0x0020U, 846 /**< Volume can be translated to dB with pa_sw_volume_to_dB(). This is a 847 * dynamic flag and may change at runtime after the sink has initialized 848 * \since 0.9.11 */ 849 850 PA_SINK_FLAT_VOLUME = 0x0040U, 851 /**< This sink is in flat volume mode, i.e.\ always the maximum of 852 * the volume of all connected inputs. \since 0.9.15 */ 853 854 PA_SINK_DYNAMIC_LATENCY = 0x0080U, 855 /**< The latency can be adjusted dynamically depending on the 856 * needs of the connected streams. \since 0.9.15 */ 857 858 PA_SINK_SET_FORMATS = 0x0100U 859 /**< The sink allows setting what formats are supported by the connected 860 * hardware. The actual functionality to do this might be provided by an 861 * extension. \since 1.0 */ 862 863 /** \cond fulldocs */ 864 /* PRIVATE: Server-side values -- do not try to use these at client-side. 865 * The server will filter out these flags anyway, so you should never see 866 * these flags in sinks. */ 867 868 /**< This sink shares the volume with the master sink (used by some filter 869 * sinks). */ 870 871 /**< The HW volume changes are syncronized with SW volume. */ 872 /** \endcond */ 873 } 874 875 alias pa_sink_flags_t = pa_sink_flags; 876 877 /** \cond fulldocs */ 878 enum PA_SINK_HW_VOLUME_CTRL = pa_sink_flags_t.PA_SINK_HW_VOLUME_CTRL; 879 enum PA_SINK_LATENCY = pa_sink_flags_t.PA_SINK_LATENCY; 880 enum PA_SINK_HARDWARE = pa_sink_flags_t.PA_SINK_HARDWARE; 881 enum PA_SINK_NETWORK = pa_sink_flags_t.PA_SINK_NETWORK; 882 enum PA_SINK_HW_MUTE_CTRL = pa_sink_flags_t.PA_SINK_HW_MUTE_CTRL; 883 enum PA_SINK_DECIBEL_VOLUME = pa_sink_flags_t.PA_SINK_DECIBEL_VOLUME; 884 enum PA_SINK_FLAT_VOLUME = pa_sink_flags_t.PA_SINK_FLAT_VOLUME; 885 enum PA_SINK_DYNAMIC_LATENCY = pa_sink_flags_t.PA_SINK_DYNAMIC_LATENCY; 886 enum PA_SINK_SET_FORMATS = pa_sink_flags_t.PA_SINK_SET_FORMATS; 887 888 /** \endcond */ 889 890 /** Sink state. \since 0.9.15 */ 891 enum pa_sink_state 892 { 893 /* enum serialized in u8 */ 894 PA_SINK_INVALID_STATE = -1, 895 /**< This state is used when the server does not support sink state introspection \since 0.9.15 */ 896 897 PA_SINK_RUNNING = 0, 898 /**< Running, sink is playing and used by at least one non-corked sink-input \since 0.9.15 */ 899 900 PA_SINK_IDLE = 1, 901 /**< When idle, the sink is playing but there is no non-corked sink-input attached to it \since 0.9.15 */ 902 903 PA_SINK_SUSPENDED = 2, 904 /**< When suspended, actual sink access can be closed, for instance \since 0.9.15 */ 905 906 /** \cond fulldocs */ 907 /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT 908 * SIDE! These values are *not* considered part of the official PA 909 * API/ABI. If you use them your application might break when PA 910 * is upgraded. Also, please note that these values are not useful 911 * on the client side anyway. */ 912 913 PA_SINK_INIT = -2, 914 /**< Initialization state */ 915 916 PA_SINK_UNLINKED = -3 917 /**< The state when the sink is getting unregistered and removed from client access */ 918 /** \endcond */ 919 } 920 921 alias pa_sink_state_t = pa_sink_state; 922 923 /** Returns non-zero if sink is playing: running or idle. \since 0.9.15 */ 924 int PA_SINK_IS_OPENED (pa_sink_state_t x); 925 926 /** Returns non-zero if sink is running. \since 1.0 */ 927 int PA_SINK_IS_RUNNING (pa_sink_state_t x); 928 929 /** \cond fulldocs */ 930 enum PA_SINK_INVALID_STATE = pa_sink_state_t.PA_SINK_INVALID_STATE; 931 enum PA_SINK_RUNNING = pa_sink_state_t.PA_SINK_RUNNING; 932 enum PA_SINK_IDLE = pa_sink_state_t.PA_SINK_IDLE; 933 enum PA_SINK_SUSPENDED = pa_sink_state_t.PA_SINK_SUSPENDED; 934 enum PA_SINK_INIT = pa_sink_state_t.PA_SINK_INIT; 935 enum PA_SINK_UNLINKED = pa_sink_state_t.PA_SINK_UNLINKED; 936 // enum PA_SINK_IS_OPENED = PA_SINK_IS_OPENED; 937 /** \endcond */ 938 939 /** Special source flags. */ 940 enum pa_source_flags 941 { 942 PA_SOURCE_NOFLAGS = 0x0000U, 943 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 944 945 PA_SOURCE_HW_VOLUME_CTRL = 0x0001U, 946 /**< Supports hardware volume control. This is a dynamic flag and may 947 * change at runtime after the source has initialized */ 948 949 PA_SOURCE_LATENCY = 0x0002U, 950 /**< Supports latency querying */ 951 952 PA_SOURCE_HARDWARE = 0x0004U, 953 /**< Is a hardware source of some kind, in contrast to 954 * "virtual"/software source \since 0.9.3 */ 955 956 PA_SOURCE_NETWORK = 0x0008U, 957 /**< Is a networked source of some kind. \since 0.9.7 */ 958 959 PA_SOURCE_HW_MUTE_CTRL = 0x0010U, 960 /**< Supports hardware mute control. This is a dynamic flag and may 961 * change at runtime after the source has initialized \since 0.9.11 */ 962 963 PA_SOURCE_DECIBEL_VOLUME = 0x0020U, 964 /**< Volume can be translated to dB with pa_sw_volume_to_dB(). This is a 965 * dynamic flag and may change at runtime after the source has initialized 966 * \since 0.9.11 */ 967 968 PA_SOURCE_DYNAMIC_LATENCY = 0x0040U, 969 /**< The latency can be adjusted dynamically depending on the 970 * needs of the connected streams. \since 0.9.15 */ 971 972 PA_SOURCE_FLAT_VOLUME = 0x0080U 973 /**< This source is in flat volume mode, i.e.\ always the maximum of 974 * the volume of all connected outputs. \since 1.0 */ 975 976 /** \cond fulldocs */ 977 /* PRIVATE: Server-side values -- do not try to use these at client-side. 978 * The server will filter out these flags anyway, so you should never see 979 * these flags in sources. */ 980 981 /**< This source shares the volume with the master source (used by some filter 982 * sources). */ 983 984 /**< The HW volume changes are syncronized with SW volume. */ 985 } 986 987 alias pa_source_flags_t = pa_source_flags; 988 989 /** \cond fulldocs */ 990 enum PA_SOURCE_HW_VOLUME_CTRL = pa_source_flags_t.PA_SOURCE_HW_VOLUME_CTRL; 991 enum PA_SOURCE_LATENCY = pa_source_flags_t.PA_SOURCE_LATENCY; 992 enum PA_SOURCE_HARDWARE = pa_source_flags_t.PA_SOURCE_HARDWARE; 993 enum PA_SOURCE_NETWORK = pa_source_flags_t.PA_SOURCE_NETWORK; 994 enum PA_SOURCE_HW_MUTE_CTRL = pa_source_flags_t.PA_SOURCE_HW_MUTE_CTRL; 995 enum PA_SOURCE_DECIBEL_VOLUME = pa_source_flags_t.PA_SOURCE_DECIBEL_VOLUME; 996 enum PA_SOURCE_DYNAMIC_LATENCY = pa_source_flags_t.PA_SOURCE_DYNAMIC_LATENCY; 997 enum PA_SOURCE_FLAT_VOLUME = pa_source_flags_t.PA_SOURCE_FLAT_VOLUME; 998 999 /** \endcond */ 1000 1001 /** Source state. \since 0.9.15 */ 1002 enum pa_source_state 1003 { 1004 PA_SOURCE_INVALID_STATE = -1, 1005 /**< This state is used when the server does not support source state introspection \since 0.9.15 */ 1006 1007 PA_SOURCE_RUNNING = 0, 1008 /**< Running, source is recording and used by at least one non-corked source-output \since 0.9.15 */ 1009 1010 PA_SOURCE_IDLE = 1, 1011 /**< When idle, the source is still recording but there is no non-corked source-output \since 0.9.15 */ 1012 1013 PA_SOURCE_SUSPENDED = 2, 1014 /**< When suspended, actual source access can be closed, for instance \since 0.9.15 */ 1015 1016 /** \cond fulldocs */ 1017 /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT 1018 * SIDE! These values are *not* considered part of the official PA 1019 * API/ABI. If you use them your application might break when PA 1020 * is upgraded. Also, please note that these values are not useful 1021 * on the client side anyway. */ 1022 1023 PA_SOURCE_INIT = -2, 1024 /**< Initialization state */ 1025 1026 PA_SOURCE_UNLINKED = -3 1027 /**< The state when the source is getting unregistered and removed from client access */ 1028 /** \endcond */ 1029 } 1030 1031 alias pa_source_state_t = pa_source_state; 1032 1033 /** Returns non-zero if source is recording: running or idle. \since 0.9.15 */ 1034 int PA_SOURCE_IS_OPENED (pa_source_state_t x); 1035 1036 /** Returns non-zero if source is running \since 1.0 */ 1037 int PA_SOURCE_IS_RUNNING (pa_source_state_t x); 1038 1039 /** \cond fulldocs */ 1040 enum PA_SOURCE_INVALID_STATE = pa_source_state_t.PA_SOURCE_INVALID_STATE; 1041 enum PA_SOURCE_RUNNING = pa_source_state_t.PA_SOURCE_RUNNING; 1042 enum PA_SOURCE_IDLE = pa_source_state_t.PA_SOURCE_IDLE; 1043 enum PA_SOURCE_SUSPENDED = pa_source_state_t.PA_SOURCE_SUSPENDED; 1044 enum PA_SOURCE_INIT = pa_source_state_t.PA_SOURCE_INIT; 1045 enum PA_SOURCE_UNLINKED = pa_source_state_t.PA_SOURCE_UNLINKED; 1046 // enum PA_SOURCE_IS_OPENED = PA_SOURCE_IS_OPENED; 1047 /** \endcond */ 1048 1049 /** A generic free() like callback prototype */ 1050 alias pa_free_cb_t = void function (void* p); 1051 1052 /** A stream policy/meta event requesting that an application should 1053 * cork a specific stream. See pa_stream_event_cb_t for more 1054 * information. \since 0.9.15 */ 1055 enum PA_STREAM_EVENT_REQUEST_CORK = "request-cork"; 1056 1057 /** A stream policy/meta event requesting that an application should 1058 * cork a specific stream. See pa_stream_event_cb_t for more 1059 * information, \since 0.9.15 */ 1060 enum PA_STREAM_EVENT_REQUEST_UNCORK = "request-uncork"; 1061 1062 /** A stream event notifying that the stream is going to be 1063 * disconnected because the underlying sink changed and no longer 1064 * supports the format that was originally negotiated. Clients need 1065 * to connect a new stream to renegotiate a format and continue 1066 * playback. \since 1.0 */ 1067 enum PA_STREAM_EVENT_FORMAT_LOST = "format-lost"; 1068 1069 /** Port availability / jack detection status 1070 * \since 2.0 */ 1071 enum pa_port_available 1072 { 1073 PA_PORT_AVAILABLE_UNKNOWN = 0, /**< This port does not support jack detection \since 2.0 */ 1074 PA_PORT_AVAILABLE_NO = 1, /**< This port is not available, likely because the jack is not plugged in. \since 2.0 */ 1075 PA_PORT_AVAILABLE_YES = 2 /**< This port is available, likely because the jack is plugged in. \since 2.0 */ 1076 } 1077 1078 alias pa_port_available_t = pa_port_available; 1079 1080 /** \cond fulldocs */ 1081 enum PA_PORT_AVAILABLE_UNKNOWN = pa_port_available_t.PA_PORT_AVAILABLE_UNKNOWN; 1082 enum PA_PORT_AVAILABLE_NO = pa_port_available_t.PA_PORT_AVAILABLE_NO; 1083 enum PA_PORT_AVAILABLE_YES = pa_port_available_t.PA_PORT_AVAILABLE_YES; 1084 1085 /** \endcond */ 1086 1087 /** Port type. New types can be added in the future, so applications should 1088 * gracefully handle situations where a type identifier doesn't match any item 1089 * in this enumeration. \since 14.0 */ 1090 enum pa_device_port_type 1091 { 1092 PA_DEVICE_PORT_TYPE_UNKNOWN = 0, 1093 PA_DEVICE_PORT_TYPE_AUX = 1, 1094 PA_DEVICE_PORT_TYPE_SPEAKER = 2, 1095 PA_DEVICE_PORT_TYPE_HEADPHONES = 3, 1096 PA_DEVICE_PORT_TYPE_LINE = 4, 1097 PA_DEVICE_PORT_TYPE_MIC = 5, 1098 PA_DEVICE_PORT_TYPE_HEADSET = 6, 1099 PA_DEVICE_PORT_TYPE_HANDSET = 7, 1100 PA_DEVICE_PORT_TYPE_EARPIECE = 8, 1101 PA_DEVICE_PORT_TYPE_SPDIF = 9, 1102 PA_DEVICE_PORT_TYPE_HDMI = 10, 1103 PA_DEVICE_PORT_TYPE_TV = 11, 1104 PA_DEVICE_PORT_TYPE_RADIO = 12, 1105 PA_DEVICE_PORT_TYPE_VIDEO = 13, 1106 PA_DEVICE_PORT_TYPE_USB = 14, 1107 PA_DEVICE_PORT_TYPE_BLUETOOTH = 15, 1108 PA_DEVICE_PORT_TYPE_PORTABLE = 16, 1109 PA_DEVICE_PORT_TYPE_HANDSFREE = 17, 1110 PA_DEVICE_PORT_TYPE_CAR = 18, 1111 PA_DEVICE_PORT_TYPE_HIFI = 19, 1112 PA_DEVICE_PORT_TYPE_PHONE = 20, 1113 PA_DEVICE_PORT_TYPE_NETWORK = 21, 1114 PA_DEVICE_PORT_TYPE_ANALOG = 22 1115 } 1116 1117 alias pa_device_port_type_t = pa_device_port_type; 1118