1#ifndef foointrospecthfoo
2#define foointrospecthfoo
3
4/***
5 This file is part of PulseAudio.
6
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9
10 PulseAudio is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published
12 by the Free Software Foundation; either version 2.1 of the License,
13 or (at your option) any later version.
14
15 PulseAudio is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include <inttypes.h>
25
26#include <pulse/operation.h>
27#include <pulse/context.h>
28#include <pulse/cdecl.h>
29#include <pulse/gccmacro.h>
30#include <pulse/channelmap.h>
31#include <pulse/volume.h>
32#include <pulse/proplist.h>
33#include <pulse/format.h>
34#include <pulse/version.h>
35
36/** \page introspect Server Query and Control
37 *
38 * \section overv_sec Overview
39 *
40 * Sometimes it is necessary to query and modify global settings in the
41 * server. For this, PulseAudio has the introspection API. It can list sinks,
42 * sources, samples and other aspects of the server. It can also modify the
43 * attributes of the server that will affect operations on a global level,
44 * and not just the application's context.
45 *
46 * \section query_sec Querying
47 *
48 * All querying is done through callbacks. This approach is necessary to
49 * maintain an asynchronous design. The client will request the information
50 * and some time later, the server will respond with the desired data.
51 *
52 * Some objects can have multiple instances on the server. When requesting all
53 * of these at once, the callback will be called multiple times, once for
54 * each object. When the list has been exhausted, the callback will be called
55 * without an information structure and the eol parameter set to a positive
56 * value.
57 *
58 * Note that even if a single object is requested, and not the entire list,
59 * the terminating call will still be made.
60 *
61 * If an error occurs, the callback will be invoked without an information
62 * structure and eol set to a negative value..
63 *
64 * Data members in the information structures are only valid during the
65 * duration of the callback. If they are required after the callback is
66 * finished, a deep copy of the information structure must be performed.
67 *
68 * \subsection server_subsec Server Information
69 *
70 * The server can be queried about its name, the environment it's running on
71 * and the currently active global defaults. Calling
72 * pa_context_get_server_info() provides access to a pa_server_info structure
73 * containing all of these.
74 *
75 * \subsection memstat_subsec Memory Usage
76 *
77 * Statistics about memory usage can be fetched using pa_context_stat(),
78 * giving a pa_stat_info structure.
79 *
80 * \subsection sinksrc_subsec Sinks and Sources
81 *
82 * The server can have an arbitrary number of sinks and sources. Each sink
83 * and source have both an index and a name associated with it. As such,
84 * there are three ways to get access to them:
85 *
86 * \li By index - pa_context_get_sink_info_by_index() /
87 * pa_context_get_source_info_by_index()
88 * \li By name - pa_context_get_sink_info_by_name() /
89 * pa_context_get_source_info_by_name()
90 * \li All - pa_context_get_sink_info_list() /
91 * pa_context_get_source_info_list()
92 *
93 * All three method use the same callback and will provide a pa_sink_info or
94 * pa_source_info structure.
95 *
96 * \subsection siso_subsec Sink Inputs and Source Outputs
97 *
98 * Sink inputs and source outputs are the representations of the client ends
99 * of streams inside the server. I.e. they connect a client stream to one of
100 * the global sinks or sources.
101 *
102 * Sink inputs and source outputs only have an index to identify them. As
103 * such, there are only two ways to get information about them:
104 *
105 * \li By index - pa_context_get_sink_input_info() /
106 * pa_context_get_source_output_info()
107 * \li All - pa_context_get_sink_input_info_list() /
108 * pa_context_get_source_output_info_list()
109 *
110 * The structure returned is the pa_sink_input_info or pa_source_output_info
111 * structure.
112 *
113 * \subsection samples_subsec Samples
114 *
115 * The list of cached samples can be retrieved from the server. Three methods
116 * exist for querying the sample cache list:
117 *
118 * \li By index - pa_context_get_sample_info_by_index()
119 * \li By name - pa_context_get_sample_info_by_name()
120 * \li All - pa_context_get_sample_info_list()
121 *
122 * Note that this only retrieves information about the sample, not the sample
123 * data itself.
124 *
125 * \subsection module_subsec Driver Modules
126 *
127 * PulseAudio driver modules are identified by index and are retrieved using either
128 * pa_context_get_module_info() or pa_context_get_module_info_list(). The
129 * information structure is called pa_module_info.
130 *
131 * \subsection client_subsec Clients
132 *
133 * PulseAudio clients are also identified by index and are retrieved using
134 * either pa_context_get_client_info() or pa_context_get_client_info_list().
135 * The information structure is called pa_client_info.
136 *
137 * \section ctrl_sec Control
138 *
139 * Some parts of the server are only possible to read, but most can also be
140 * modified in different ways. Note that these changes will affect all
141 * connected clients and not just the one issuing the request.
142 *
143 * \subsection sinksrc_subsec Sinks and Sources
144 *
145 * The most common change one would want to apply to sinks and sources is to
146 * modify the volume of the audio. Identically to how sinks and sources can
147 * be queried, there are two ways of identifying them:
148 *
149 * \li By index - pa_context_set_sink_volume_by_index() /
150 * pa_context_set_source_volume_by_index()
151 * \li By name - pa_context_set_sink_volume_by_name() /
152 * pa_context_set_source_volume_by_name()
153 *
154 * It is also possible to mute a sink or source:
155 *
156 * \li By index - pa_context_set_sink_mute_by_index() /
157 * pa_context_set_source_mute_by_index()
158 * \li By name - pa_context_set_sink_mute_by_name() /
159 * pa_context_set_source_mute_by_name()
160 *
161 * \subsection siso_subsec Sink Inputs and Source Outputs
162 *
163 * If an application desires to modify the volume of just a single stream
164 * (commonly one of its own streams), this can be done by setting the volume
165 * of its associated sink input or source output, using
166 * pa_context_set_sink_input_volume() or pa_context_set_source_output_volume().
167 *
168 * It is also possible to remove sink inputs and source outputs, terminating
169 * the streams associated with them:
170 *
171 * \li Sink input - pa_context_kill_sink_input()
172 * \li Source output - pa_context_kill_source_output()
173 *
174 * It is strongly recommended that all volume changes are done as a direct
175 * result of user input. With automated requests, such as those resulting
176 * from misguided attempts of crossfading, PulseAudio can store the stream
177 * volume at an inappropriate moment and restore it later. Besides, such
178 * attempts lead to OSD popups in some desktop environments.
179 *
180 * As a special case of the general rule above, it is recommended that your
181 * application leaves the task of saving and restoring the volume of its
182 * streams to PulseAudio and does not attempt to do it by itself. PulseAudio
183 * really knows better about events such as stream moving or headphone
184 * plugging that would make the volume stored by the application inapplicable
185 * to the new configuration.
186 *
187 * Another important case where setting a sink input volume may be a bad idea
188 * is related to interpreters that interpret potentially untrusted scripts.
189 * PulseAudio relies on your application not making malicious requests (such
190 * as repeatedly setting the volume to 100%). Thus, script interpreters that
191 * represent a security boundary must sandbox volume-changing requests coming
192 * from their scripts. In the worst case, it may be necessary to apply the
193 * script-requested volume to the script-produced sounds by altering the
194 * samples in the script interpreter and not touching the sink or sink input
195 * volume as seen by PulseAudio.
196 *
197 * If an application changes any volume, it should also listen to changes of
198 * the same volume originating from outside the application (e.g., from the
199 * system mixer application) and update its user interface accordingly. Use
200 * \ref subscribe to get such notifications.
201 *
202 * \subsection module_subsec Modules
203 *
204 * Server modules can be remotely loaded and unloaded using
205 * pa_context_load_module() and pa_context_unload_module().
206 *
207 * \subsection message_subsec Messages
208 *
209 * Server objects like sinks, sink inputs or modules can register a message
210 * handler to communicate with clients. A message can be sent to a named
211 * message handler using pa_context_send_message_to_object().
212 *
213 * \subsection client_subsec Clients
214 *
215 * The only operation supported on clients is the possibility of kicking
216 * them off the server using pa_context_kill_client().
217 */
218
219/** \file
220 *
221 * Routines for daemon introspection.
222 *
223 * See also \subpage introspect
224 */
225
226PA_C_DECL_BEGIN
227
228/** @{ \name Sinks */
229
230/** Stores information about a specific port of a sink. Please
231 * note that this structure can be extended as part of evolutionary
232 * API updates at any time in any new release. \since 0.9.16 */
233typedef struct pa_sink_port_info {
234 const char *name; /**< Name of this port */
235 const char *description; /**< Description of this port */
236 uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */
237 int available; /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */
238 const char *availability_group; /**< An indentifier for the group of ports that share their availability status with
239 * each other. This is meant especially for handling cases where one 3.5 mm connector
240 * is used for headphones, headsets and microphones, and the hardware can only tell
241 * that something was plugged in but not what exactly. In this situation the ports for
242 * all those devices share their availability status, and PulseAudio can't tell which
243 * one is actually plugged in, and some application may ask the user what was plugged
244 * in. Such applications should get a list of all card ports and compare their
245 * `availability_group` fields. Ports that have the same group are those that need
246 * input from the user to determine which device was plugged in. The application should
247 * then activate the user-chosen port.
248 *
249 * May be NULL, in which case the port is not part of any availability group.
250 *
251 * The group identifier must be treated as an opaque identifier. The string may look
252 * like an ALSA control name, but applications must not assume any such relationship.
253 * The group naming scheme can change without a warning.
254 *
255 * Since one group can include both input and output ports, the grouping should be done
256 * using pa_card_port_info instead of pa_sink_port_info, but this field is duplicated
257 * also in pa_sink_port_info (and pa_source_port_info) in case someone finds that
258 * convenient.
259 *
260 * \since 14.0 */
261 uint32_t type; /**< Port type, see #pa_device_port_type. \since 14.0 */
262} pa_sink_port_info;
263
264/** Stores information about sinks. Please note that this structure
265 * can be extended as part of evolutionary API updates at any time in
266 * any new release. */
267typedef struct pa_sink_info {
268 const char *name; /**< Name of the sink */
269 uint32_t index; /**< Index of the sink */
270 const char *description; /**< Description of this sink */
271 pa_sample_spec sample_spec; /**< Sample spec of this sink */
272 pa_channel_map channel_map; /**< Channel map */
273 uint32_t owner_module; /**< Index of the owning module of this sink, or PA_INVALID_INDEX. */
274 pa_cvolume volume; /**< Volume of the sink */
275 int mute; /**< Mute switch of the sink */
276 uint32_t monitor_source; /**< Index of the monitor source connected to this sink. */
277 const char *monitor_source_name; /**< The name of the monitor source. */
278 pa_usec_t latency; /**< Length of queued audio in the output buffer. */
279 const char *driver; /**< Driver name */
280 pa_sink_flags_t flags; /**< Flags */
281 pa_proplist *proplist; /**< Property list \since 0.9.11 */
282 pa_usec_t configured_latency; /**< The latency this device has been configured to. \since 0.9.11 */
283 pa_volume_t base_volume; /**< Some kind of "base" volume that refers to unamplified/unattenuated volume in the context of the output device. \since 0.9.15 */
284 pa_sink_state_t state; /**< State \since 0.9.15 */
285 uint32_t n_volume_steps; /**< Number of volume steps for sinks which do not support arbitrary volumes. \since 0.9.15 */
286 uint32_t card; /**< Card index, or PA_INVALID_INDEX. \since 0.9.15 */
287 uint32_t n_ports; /**< Number of entries in port array \since 0.9.16 */
288 pa_sink_port_info** ports; /**< Array of available ports, or NULL. Array is terminated by an entry set to NULL. The number of entries is stored in n_ports. \since 0.9.16 */
289 pa_sink_port_info* active_port; /**< Pointer to active port in the array, or NULL. \since 0.9.16 */
290 uint8_t n_formats; /**< Number of formats supported by the sink. \since 1.0 */
291 pa_format_info **formats; /**< Array of formats supported by the sink. \since 1.0 */
292} pa_sink_info;
293
294/** Callback prototype for pa_context_get_sink_info_by_name() and friends */
295typedef void (*pa_sink_info_cb_t)(pa_context *c, const pa_sink_info *i, int eol, void *userdata);
296
297/** Get information about a sink by its name */
298pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name, pa_sink_info_cb_t cb, void *userdata);
299
300/** Get information about a sink by its index */
301pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t idx, pa_sink_info_cb_t cb, void *userdata);
302
303/** Get the complete sink list */
304pa_operation* pa_context_get_sink_info_list(pa_context *c, pa_sink_info_cb_t cb, void *userdata);
305
306/** Set the volume of a sink device specified by its index */
307pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
308
309/** Set the volume of a sink device specified by its name */
310pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
311
312/** Set the mute switch of a sink device specified by its index */
313pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
314
315/** Set the mute switch of a sink device specified by its name */
316pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata);
317
318/** Suspend/Resume a sink. \since 0.9.7 */
319pa_operation* pa_context_suspend_sink_by_name(pa_context *c, const char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata);
320
321/** Suspend/Resume a sink. If idx is PA_INVALID_INDEX all sinks will be suspended. \since 0.9.7 */
322pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata);
323
324/** Change the profile of a sink. \since 0.9.16 */
325pa_operation* pa_context_set_sink_port_by_index(pa_context *c, uint32_t idx, const char*port, pa_context_success_cb_t cb, void *userdata);
326
327/** Change the profile of a sink. \since 0.9.15 */
328pa_operation* pa_context_set_sink_port_by_name(pa_context *c, const char*name, const char*port, pa_context_success_cb_t cb, void *userdata);
329
330/** @} */
331
332/** @{ \name Sources */
333
334/** Stores information about a specific port of a source. Please
335 * note that this structure can be extended as part of evolutionary
336 * API updates at any time in any new release. \since 0.9.16 */
337typedef struct pa_source_port_info {
338 const char *name; /**< Name of this port */
339 const char *description; /**< Description of this port */
340 uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */
341 int available; /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */
342 const char *availability_group; /**< An indentifier for the group of ports that share their availability status with
343 * each other. This is meant especially for handling cases where one 3.5 mm connector
344 * is used for headphones, headsets and microphones, and the hardware can only tell
345 * that something was plugged in but not what exactly. In this situation the ports for
346 * all those devices share their availability status, and PulseAudio can't tell which
347 * one is actually plugged in, and some application may ask the user what was plugged
348 * in. Such applications should get a list of all card ports and compare their
349 * `availability_group` fields. Ports that have the same group are those that need
350 * input from the user to determine which device was plugged in. The application should
351 * then activate the user-chosen port.
352 *
353 * May be NULL, in which case the port is not part of any availability group (which is
354 * the same as having a group with only one member).
355 *
356 * The group identifier must be treated as an opaque identifier. The string may look
357 * like an ALSA control name, but applications must not assume any such relationship.
358 * The group naming scheme can change without a warning.
359 *
360 * Since one group can include both input and output ports, the grouping should be done
361 * using pa_card_port_info instead of pa_source_port_info, but this field is duplicated
362 * also in pa_source_port_info (and pa_sink_port_info) in case someone finds that
363 * convenient.
364 *
365 * \since 14.0 */
366 uint32_t type; /**< Port type, see #pa_device_port_type. \since 14.0 */
367} pa_source_port_info;
368
369/** Stores information about sources. Please note that this structure
370 * can be extended as part of evolutionary API updates at any time in
371 * any new release. */
372typedef struct pa_source_info {
373 const char *name; /**< Name of the source */
374 uint32_t index; /**< Index of the source */
375 const char *description; /**< Description of this source */
376 pa_sample_spec sample_spec; /**< Sample spec of this source */
377 pa_channel_map channel_map; /**< Channel map */
378 uint32_t owner_module; /**< Owning module index, or PA_INVALID_INDEX. */
379 pa_cvolume volume; /**< Volume of the source */
380 int mute; /**< Mute switch of the sink */
381 uint32_t monitor_of_sink; /**< If this is a monitor source, the index of the owning sink, otherwise PA_INVALID_INDEX. */
382 const char *monitor_of_sink_name; /**< Name of the owning sink, or NULL. */
383 pa_usec_t latency; /**< Length of filled record buffer of this source. */
384 const char *driver; /**< Driver name */
385 pa_source_flags_t flags; /**< Flags */
386 pa_proplist *proplist; /**< Property list \since 0.9.11 */
387 pa_usec_t configured_latency; /**< The latency this device has been configured to. \since 0.9.11 */
388 pa_volume_t base_volume; /**< Some kind of "base" volume that refers to unamplified/unattenuated volume in the context of the input device. \since 0.9.15 */
389 pa_source_state_t state; /**< State \since 0.9.15 */
390 uint32_t n_volume_steps; /**< Number of volume steps for sources which do not support arbitrary volumes. \since 0.9.15 */
391 uint32_t card; /**< Card index, or PA_INVALID_INDEX. \since 0.9.15 */
392 uint32_t n_ports; /**< Number of entries in port array \since 0.9.16 */
393 pa_source_port_info** ports; /**< Array of available ports, or NULL. Array is terminated by an entry set to NULL. The number of entries is stored in n_ports. \since 0.9.16 */
394 pa_source_port_info* active_port; /**< Pointer to active port in the array, or NULL. \since 0.9.16 */
395 uint8_t n_formats; /**< Number of formats supported by the source. \since 1.0 */
396 pa_format_info **formats; /**< Array of formats supported by the source. \since 1.0 */
397} pa_source_info;
398
399/** Callback prototype for pa_context_get_source_info_by_name() and friends */
400typedef void (*pa_source_info_cb_t)(pa_context *c, const pa_source_info *i, int eol, void *userdata);
401
402/** Get information about a source by its name */
403pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name, pa_source_info_cb_t cb, void *userdata);
404
405/** Get information about a source by its index */
406pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t idx, pa_source_info_cb_t cb, void *userdata);
407
408/** Get the complete source list */
409pa_operation* pa_context_get_source_info_list(pa_context *c, pa_source_info_cb_t cb, void *userdata);
410
411/** Set the volume of a source device specified by its index */
412pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
413
414/** Set the volume of a source device specified by its name */
415pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
416
417/** Set the mute switch of a source device specified by its index */
418pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
419
420/** Set the mute switch of a source device specified by its name */
421pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata);
422
423/** Suspend/Resume a source. \since 0.9.7 */
424pa_operation* pa_context_suspend_source_by_name(pa_context *c, const char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata);
425
426/** Suspend/Resume a source. If idx is PA_INVALID_INDEX, all sources will be suspended. \since 0.9.7 */
427pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata);
428
429/** Change the profile of a source. \since 0.9.16 */
430pa_operation* pa_context_set_source_port_by_index(pa_context *c, uint32_t idx, const char*port, pa_context_success_cb_t cb, void *userdata);
431
432/** Change the profile of a source. \since 0.9.15 */
433pa_operation* pa_context_set_source_port_by_name(pa_context *c, const char*name, const char*port, pa_context_success_cb_t cb, void *userdata);
434
435/** @} */
436
437/** @{ \name Server */
438
439/** Server information. Please note that this structure can be
440 * extended as part of evolutionary API updates at any time in any new
441 * release. */
442typedef struct pa_server_info {
443 const char *user_name; /**< User name of the daemon process */
444 const char *host_name; /**< Host name the daemon is running on */
445 const char *server_version; /**< Version string of the daemon */
446 const char *server_name; /**< Server package name (usually "pulseaudio") */
447 pa_sample_spec sample_spec; /**< Default sample specification */
448 const char *default_sink_name; /**< Name of default sink. */
449 const char *default_source_name; /**< Name of default source. */
450 uint32_t cookie; /**< A random cookie for identifying this instance of PulseAudio. */
451 pa_channel_map channel_map; /**< Default channel map. \since 0.9.15 */
452} pa_server_info;
453
454/** Callback prototype for pa_context_get_server_info() */
455typedef void (*pa_server_info_cb_t) (pa_context *c, const pa_server_info*i, void *userdata);
456
457/** Get some information about the server */
458pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata);
459
460/** @} */
461
462/** @{ \name Modules */
463
464/** Stores information about modules. Please note that this structure
465 * can be extended as part of evolutionary API updates at any time in
466 * any new release. */
467typedef struct pa_module_info {
468 uint32_t index; /**< Index of the module */
469 const char*name, /**< Name of the module */
470 *argument; /**< Argument string of the module */
471 uint32_t n_used; /**< Usage counter or PA_INVALID_INDEX */
472/** \cond fulldocs */
473 int auto_unload; /**< \deprecated Non-zero if this is an autoloaded module. */
474/** \endcond */
475 pa_proplist *proplist; /**< Property list \since 0.9.15 */
476} pa_module_info;
477
478/** Callback prototype for pa_context_get_module_info() and friends */
479typedef void (*pa_module_info_cb_t) (pa_context *c, const pa_module_info*i, int eol, void *userdata);
480
481/** Get some information about a module by its index */
482pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_info_cb_t cb, void *userdata);
483
484/** Get the complete list of currently loaded modules */
485pa_operation* pa_context_get_module_info_list(pa_context *c, pa_module_info_cb_t cb, void *userdata);
486
487/** Callback prototype for pa_context_load_module() */
488typedef void (*pa_context_index_cb_t)(pa_context *c, uint32_t idx, void *userdata);
489
490/** Load a module. */
491pa_operation* pa_context_load_module(pa_context *c, const char*name, const char *argument, pa_context_index_cb_t cb, void *userdata);
492
493/** Unload a module. */
494pa_operation* pa_context_unload_module(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
495
496/** @} */
497
498/** @{ \name Messages */
499
500/** Callback prototype for pa_context_send_message_to_object() \since 15.0 */
501typedef void (*pa_context_string_cb_t)(pa_context *c, int success, char *response, void *userdata);
502
503/** Send a message to an object that registered a message handler. For more information
504 * see https://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/doc/messaging_api.txt. \since 15.0 */
505pa_operation* pa_context_send_message_to_object(pa_context *c, const char *recipient_name, const char *message, const char *message_parameters, pa_context_string_cb_t cb, void *userdata);
506
507/** @} */
508
509/** @{ \name Clients */
510
511/** Stores information about clients. Please note that this structure
512 * can be extended as part of evolutionary API updates at any time in
513 * any new release. */
514typedef struct pa_client_info {
515 uint32_t index; /**< Index of this client */
516 const char *name; /**< Name of this client */
517 uint32_t owner_module; /**< Index of the owning module, or PA_INVALID_INDEX. */
518 const char *driver; /**< Driver name */
519 pa_proplist *proplist; /**< Property list \since 0.9.11 */
520} pa_client_info;
521
522/** Callback prototype for pa_context_get_client_info() and friends */
523typedef void (*pa_client_info_cb_t) (pa_context *c, const pa_client_info*i, int eol, void *userdata);
524
525/** Get information about a client by its index */
526pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_info_cb_t cb, void *userdata);
527
528/** Get the complete client list */
529pa_operation* pa_context_get_client_info_list(pa_context *c, pa_client_info_cb_t cb, void *userdata);
530
531/** Kill a client. */
532pa_operation* pa_context_kill_client(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
533
534/** @} */
535
536/** @{ \name Cards */
537
538/** \deprecated Superseded by pa_card_profile_info2 \since 0.9.15 */
539typedef struct pa_card_profile_info {
540 const char *name; /**< Name of this profile */
541 const char *description; /**< Description of this profile */
542 uint32_t n_sinks; /**< Number of sinks this profile would create */
543 uint32_t n_sources; /**< Number of sources this profile would create */
544 uint32_t priority; /**< The higher this value is, the more useful this profile is as a default. */
545} pa_card_profile_info;
546
547/** Stores information about a specific profile of a card. Please
548 * note that this structure can be extended as part of evolutionary
549 * API updates at any time in any new release. \since 5.0 */
550typedef struct pa_card_profile_info2 {
551 const char *name; /**< Name of this profile */
552 const char *description; /**< Description of this profile */
553 uint32_t n_sinks; /**< Number of sinks this profile would create */
554 uint32_t n_sources; /**< Number of sources this profile would create */
555 uint32_t priority; /**< The higher this value is, the more useful this profile is as a default. */
556 int available;
557 /**< Is this profile available? If this is zero, meaning "unavailable",
558 * then it makes no sense to try to activate this profile. If this is
559 * non-zero, it's still not a guarantee that activating the profile will
560 * result in anything useful, it just means that the server isn't aware of
561 * any reason why the profile would definitely be useless. \since 5.0 */
562} pa_card_profile_info2;
563
564/** Stores information about a specific port of a card. Please
565 * note that this structure can be extended as part of evolutionary
566 * API updates at any time in any new release. \since 2.0 */
567typedef struct pa_card_port_info {
568 const char *name; /**< Name of this port */
569 const char *description; /**< Description of this port */
570 uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */
571 int available; /**< A #pa_port_available enum, indicating availability status of this port. */
572 int direction; /**< A #pa_direction enum, indicating the direction of this port. */
573 uint32_t n_profiles; /**< Number of entries in profile array */
574 pa_card_profile_info** profiles; /**< \deprecated Superseded by profiles2 */
575 pa_proplist *proplist; /**< Property list */
576 int64_t latency_offset; /**< Latency offset of the port that gets added to the sink/source latency when the port is active. \since 3.0 */
577 pa_card_profile_info2** profiles2; /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. \since 5.0 */
578 const char *availability_group; /**< An indentifier for the group of ports that share their availability status with
579 * each other. This is meant especially for handling cases where one 3.5 mm connector
580 * is used for headphones, headsets and microphones, and the hardware can only tell
581 * that something was plugged in but not what exactly. In this situation the ports for
582 * all those devices share their availability status, and PulseAudio can't tell which
583 * one is actually plugged in, and some application may ask the user what was plugged
584 * in. Such applications should get a list of all card ports and compare their
585 * `availability_group` fields. Ports that have the same group are those that need
586 * input from the user to determine which device was plugged in. The application should
587 * then activate the user-chosen port.
588 *
589 * May be NULL, in which case the port is not part of any availability group (which is
590 * the same as having a group with only one member).
591 *
592 * The group identifier must be treated as an opaque identifier. The string may look
593 * like an ALSA control name, but applications must not assume any such relationship.
594 * The group naming scheme can change without a warning.
595 *
596 * \since 14.0 */
597 uint32_t type; /**< Port type, see #pa_device_port_type. \since 14.0 */
598} pa_card_port_info;
599
600/** Stores information about cards. Please note that this structure
601 * can be extended as part of evolutionary API updates at any time in
602 * any new release. \since 0.9.15 */
603typedef struct pa_card_info {
604 uint32_t index; /**< Index of this card */
605 const char *name; /**< Name of this card */
606 uint32_t owner_module; /**< Index of the owning module, or PA_INVALID_INDEX. */
607 const char *driver; /**< Driver name */
608 uint32_t n_profiles; /**< Number of entries in profile array */
609 pa_card_profile_info* profiles; /**< \deprecated Superseded by profiles2 */
610 pa_card_profile_info* active_profile; /**< \deprecated Superseded by active_profile2 */
611 pa_proplist *proplist; /**< Property list */
612 uint32_t n_ports; /**< Number of entries in port array */
613 pa_card_port_info **ports; /**< Array of pointers to ports, or NULL. Array is terminated by an entry set to NULL. */
614 pa_card_profile_info2** profiles2; /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. \since 5.0 */
615 pa_card_profile_info2* active_profile2; /**< Pointer to active profile in the array, or NULL. \since 5.0 */
616} pa_card_info;
617
618/** Callback prototype for pa_context_get_card_info_...() \since 0.9.15 */
619typedef void (*pa_card_info_cb_t) (pa_context *c, const pa_card_info*i, int eol, void *userdata);
620
621/** Get information about a card by its index \since 0.9.15 */
622pa_operation* pa_context_get_card_info_by_index(pa_context *c, uint32_t idx, pa_card_info_cb_t cb, void *userdata);
623
624/** Get information about a card by its name \since 0.9.15 */
625pa_operation* pa_context_get_card_info_by_name(pa_context *c, const char *name, pa_card_info_cb_t cb, void *userdata);
626
627/** Get the complete card list \since 0.9.15 */
628pa_operation* pa_context_get_card_info_list(pa_context *c, pa_card_info_cb_t cb, void *userdata);
629
630/** Change the profile of a card. \since 0.9.15 */
631pa_operation* pa_context_set_card_profile_by_index(pa_context *c, uint32_t idx, const char*profile, pa_context_success_cb_t cb, void *userdata);
632
633/** Change the profile of a card. \since 0.9.15 */
634pa_operation* pa_context_set_card_profile_by_name(pa_context *c, const char*name, const char*profile, pa_context_success_cb_t cb, void *userdata);
635
636/** Set the latency offset of a port. \since 3.0 */
637pa_operation* pa_context_set_port_latency_offset(pa_context *c, const char *card_name, const char *port_name, int64_t offset, pa_context_success_cb_t cb, void *userdata);
638
639/** @} */
640
641/** @{ \name Sink Inputs */
642
643/** Stores information about sink inputs. Please note that this structure
644 * can be extended as part of evolutionary API updates at any time in
645 * any new release. */
646typedef struct pa_sink_input_info {
647 uint32_t index; /**< Index of the sink input */
648 const char *name; /**< Name of the sink input */
649 uint32_t owner_module; /**< Index of the module this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any module. */
650 uint32_t client; /**< Index of the client this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any client. */
651 uint32_t sink; /**< Index of the connected sink */
652 pa_sample_spec sample_spec; /**< The sample specification of the sink input. */
653 pa_channel_map channel_map; /**< Channel map */
654 pa_cvolume volume; /**< The volume of this sink input. */
655 pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_timing_info for details. */
656 pa_usec_t sink_usec; /**< Latency of the sink device, see pa_timing_info for details. */
657 const char *resample_method; /**< The resampling method used by this sink input. */
658 const char *driver; /**< Driver name */
659 int mute; /**< Stream muted \since 0.9.7 */
660 pa_proplist *proplist; /**< Property list \since 0.9.11 */
661 int corked; /**< Stream corked \since 1.0 */
662 int has_volume; /**< Stream has volume. If not set, then the meaning of this struct's volume member is unspecified. \since 1.0 */
663 int volume_writable; /**< The volume can be set. If not set, the volume can still change even though clients can't control the volume. \since 1.0 */
664 pa_format_info *format; /**< Stream format information. \since 1.0 */
665} pa_sink_input_info;
666
667/** Callback prototype for pa_context_get_sink_input_info() and friends */
668typedef void (*pa_sink_input_info_cb_t) (pa_context *c, const pa_sink_input_info *i, int eol, void *userdata);
669
670/** Get some information about a sink input by its index */
671pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata);
672
673/** Get the complete sink input list */
674pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata);
675
676/** Move the specified sink input to a different sink. \since 0.9.5 */
677pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, const char *sink_name, pa_context_success_cb_t cb, void* userdata);
678
679/** Move the specified sink input to a different sink. \since 0.9.5 */
680pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, uint32_t sink_idx, pa_context_success_cb_t cb, void* userdata);
681
682/** Set the volume of a sink input stream */
683pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
684
685/** Set the mute switch of a sink input stream \since 0.9.7 */
686pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
687
688/** Kill a sink input. */
689pa_operation* pa_context_kill_sink_input(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
690
691/** @} */
692
693/** @{ \name Source Outputs */
694
695/** Stores information about source outputs. Please note that this structure
696 * can be extended as part of evolutionary API updates at any time in
697 * any new release. */
698typedef struct pa_source_output_info {
699 uint32_t index; /**< Index of the source output */
700 const char *name; /**< Name of the source output */
701 uint32_t owner_module; /**< Index of the module this source output belongs to, or PA_INVALID_INDEX when it does not belong to any module. */
702 uint32_t client; /**< Index of the client this source output belongs to, or PA_INVALID_INDEX when it does not belong to any client. */
703 uint32_t source; /**< Index of the connected source */
704 pa_sample_spec sample_spec; /**< The sample specification of the source output */
705 pa_channel_map channel_map; /**< Channel map */
706 pa_usec_t buffer_usec; /**< Latency due to buffering in the source output, see pa_timing_info for details. */
707 pa_usec_t source_usec; /**< Latency of the source device, see pa_timing_info for details. */
708 const char *resample_method; /**< The resampling method used by this source output. */
709 const char *driver; /**< Driver name */
710 pa_proplist *proplist; /**< Property list \since 0.9.11 */
711 int corked; /**< Stream corked \since 1.0 */
712 pa_cvolume volume; /**< The volume of this source output \since 1.0 */
713 int mute; /**< Stream muted \since 1.0 */
714 int has_volume; /**< Stream has volume. If not set, then the meaning of this struct's volume member is unspecified. \since 1.0 */
715 int volume_writable; /**< The volume can be set. If not set, the volume can still change even though clients can't control the volume. \since 1.0 */
716 pa_format_info *format; /**< Stream format information. \since 1.0 */
717} pa_source_output_info;
718
719/** Callback prototype for pa_context_get_source_output_info() and friends */
720typedef void (*pa_source_output_info_cb_t) (pa_context *c, const pa_source_output_info *i, int eol, void *userdata);
721
722/** Get information about a source output by its index */
723pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_source_output_info_cb_t cb, void *userdata);
724
725/** Get the complete list of source outputs */
726pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_output_info_cb_t cb, void *userdata);
727
728/** Move the specified source output to a different source. \since 0.9.5 */
729pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, const char *source_name, pa_context_success_cb_t cb, void* userdata);
730
731/** Move the specified source output to a different source. \since 0.9.5 */
732pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata);
733
734/** Set the volume of a source output stream \since 1.0 */
735pa_operation* pa_context_set_source_output_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
736
737/** Set the mute switch of a source output stream \since 1.0 */
738pa_operation* pa_context_set_source_output_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);
739
740/** Kill a source output. */
741pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);
742
743/** @} */
744
745/** @{ \name Statistics */
746
747/** Memory block statistics. Please note that this structure
748 * can be extended as part of evolutionary API updates at any time in
749 * any new release. */
750typedef struct pa_stat_info {
751 uint32_t memblock_total; /**< Currently allocated memory blocks */
752 uint32_t memblock_total_size; /**< Current total size of allocated memory blocks */
753 uint32_t memblock_allocated; /**< Allocated memory blocks during the whole lifetime of the daemon. */
754 uint32_t memblock_allocated_size; /**< Total size of all memory blocks allocated during the whole lifetime of the daemon. */
755 uint32_t scache_size; /**< Total size of all sample cache entries. */
756} pa_stat_info;
757
758/** Callback prototype for pa_context_stat() */
759typedef void (*pa_stat_info_cb_t) (pa_context *c, const pa_stat_info *i, void *userdata);
760
761/** Get daemon memory block statistics */
762pa_operation* pa_context_stat(pa_context *c, pa_stat_info_cb_t cb, void *userdata);
763
764/** @} */
765
766/** @{ \name Cached Samples */
767
768/** Stores information about sample cache entries. Please note that this structure
769 * can be extended as part of evolutionary API updates at any time in
770 * any new release. */
771typedef struct pa_sample_info {
772 uint32_t index; /**< Index of this entry */
773 const char *name; /**< Name of this entry */
774 pa_cvolume volume; /**< Default volume of this entry */
775 pa_sample_spec sample_spec; /**< Sample specification of the sample */
776 pa_channel_map channel_map; /**< The channel map */
777 pa_usec_t duration; /**< Duration of this entry */
778 uint32_t bytes; /**< Length of this sample in bytes. */
779 int lazy; /**< Non-zero when this is a lazy cache entry. */
780 const char *filename; /**< In case this is a lazy cache entry, the filename for the sound file to be loaded on demand. */
781 pa_proplist *proplist; /**< Property list for this sample. \since 0.9.11 */
782} pa_sample_info;
783
784/** Callback prototype for pa_context_get_sample_info_by_name() and friends */
785typedef void (*pa_sample_info_cb_t)(pa_context *c, const pa_sample_info *i, int eol, void *userdata);
786
787/** Get information about a sample by its name */
788pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name, pa_sample_info_cb_t cb, void *userdata);
789
790/** Get information about a sample by its index */
791pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, pa_sample_info_cb_t cb, void *userdata);
792
793/** Get the complete list of samples stored in the daemon. */
794pa_operation* pa_context_get_sample_info_list(pa_context *c, pa_sample_info_cb_t cb, void *userdata);
795
796/** @} */
797
798/** \cond fulldocs */
799
800/** @{ \name Autoload Entries */
801
802/** \deprecated Type of an autoload entry. */
803typedef enum pa_autoload_type {
804 PA_AUTOLOAD_SINK = 0,
805 PA_AUTOLOAD_SOURCE = 1
806} pa_autoload_type_t;
807
808/** \deprecated Stores information about autoload entries. Please note that this structure
809 * can be extended as part of evolutionary API updates at any time in
810 * any new release. */
811typedef struct pa_autoload_info {
812 uint32_t index; /**< Index of this autoload entry */
813 const char *name; /**< Name of the sink or source */
814 pa_autoload_type_t type; /**< Type of the autoload entry */
815 const char *module; /**< Module name to load */
816 const char *argument; /**< Argument string for module */
817} pa_autoload_info;
818
819/** \deprecated Callback prototype for pa_context_get_autoload_info_by_name() and friends */
820typedef void (*pa_autoload_info_cb_t)(pa_context *c, const pa_autoload_info *i, int eol, void *userdata);
821
822/** \deprecated Get info about a specific autoload entry. */
823pa_operation* pa_context_get_autoload_info_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_autoload_info_cb_t cb, void *userdata) PA_GCC_DEPRECATED;
824
825/** \deprecated Get info about a specific autoload entry. */
826pa_operation* pa_context_get_autoload_info_by_index(pa_context *c, uint32_t idx, pa_autoload_info_cb_t cb, void *userdata) PA_GCC_DEPRECATED;
827
828/** \deprecated Get the complete list of autoload entries. */
829pa_operation* pa_context_get_autoload_info_list(pa_context *c, pa_autoload_info_cb_t cb, void *userdata) PA_GCC_DEPRECATED;
830
831/** \deprecated Add a new autoload entry. */
832pa_operation* pa_context_add_autoload(pa_context *c, const char *name, pa_autoload_type_t type, const char *module, const char*argument, pa_context_index_cb_t, void* userdata) PA_GCC_DEPRECATED;
833
834/** \deprecated Remove an autoload entry. */
835pa_operation* pa_context_remove_autoload_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_context_success_cb_t cb, void* userdata) PA_GCC_DEPRECATED;
836
837/** \deprecated Remove an autoload entry. */
838pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void* userdata) PA_GCC_DEPRECATED;
839
840/** @} */
841
842/** \endcond */
843
844PA_C_DECL_END
845
846#endif
847

source code of include/pulse/introspect.h