Path: blob/master/thirdparty/linuxbsd_headers/pulse/introspect.h
9905 views
#ifndef foointrospecthfoo1#define foointrospecthfoo23/***4This file is part of PulseAudio.56Copyright 2004-2006 Lennart Poettering7Copyright 2006 Pierre Ossman <[email protected]> for Cendio AB89PulseAudio is free software; you can redistribute it and/or modify10it under the terms of the GNU Lesser General Public License as published11by the Free Software Foundation; either version 2.1 of the License,12or (at your option) any later version.1314PulseAudio is distributed in the hope that it will be useful, but15WITHOUT ANY WARRANTY; without even the implied warranty of16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU17General Public License for more details.1819You should have received a copy of the GNU Lesser General Public License20along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.21***/2223#include <inttypes.h>2425#include <pulse/operation.h>26#include <pulse/context.h>27#include <pulse/cdecl.h>28#include <pulse/gccmacro.h>29#include <pulse/channelmap.h>30#include <pulse/volume.h>31#include <pulse/proplist.h>32#include <pulse/format.h>33#include <pulse/version.h>3435/** \page introspect Server Query and Control36*37* \section overv_sec Overview38*39* Sometimes it is necessary to query and modify global settings in the40* server. For this, PulseAudio has the introspection API. It can list sinks,41* sources, samples and other aspects of the server. It can also modify the42* attributes of the server that will affect operations on a global level,43* and not just the application's context.44*45* \section query_sec Querying46*47* All querying is done through callbacks. This approach is necessary to48* maintain an asynchronous design. The client will request the information49* and some time later, the server will respond with the desired data.50*51* Some objects can have multiple instances on the server. When requesting all52* of these at once, the callback will be called multiple times, once for53* each object. When the list has been exhausted, the callback will be called54* without an information structure and the eol parameter set to a positive55* value.56*57* Note that even if a single object is requested, and not the entire list,58* the terminating call will still be made.59*60* If an error occurs, the callback will be invoked without an information61* structure and eol set to a negative value..62*63* Data members in the information structures are only valid during the64* duration of the callback. If they are required after the callback is65* finished, a deep copy of the information structure must be performed.66*67* \subsection server_subsec Server Information68*69* The server can be queried about its name, the environment it's running on70* and the currently active global defaults. Calling71* pa_context_get_server_info() provides access to a pa_server_info structure72* containing all of these.73*74* \subsection memstat_subsec Memory Usage75*76* Statistics about memory usage can be fetched using pa_context_stat(),77* giving a pa_stat_info structure.78*79* \subsection sinksrc_subsec Sinks and Sources80*81* The server can have an arbitrary number of sinks and sources. Each sink82* and source have both an index and a name associated with it. As such,83* there are three ways to get access to them:84*85* \li By index - pa_context_get_sink_info_by_index() /86* pa_context_get_source_info_by_index()87* \li By name - pa_context_get_sink_info_by_name() /88* pa_context_get_source_info_by_name()89* \li All - pa_context_get_sink_info_list() /90* pa_context_get_source_info_list()91*92* All three method use the same callback and will provide a pa_sink_info or93* pa_source_info structure.94*95* \subsection siso_subsec Sink Inputs and Source Outputs96*97* Sink inputs and source outputs are the representations of the client ends98* of streams inside the server. I.e. they connect a client stream to one of99* the global sinks or sources.100*101* Sink inputs and source outputs only have an index to identify them. As102* such, there are only two ways to get information about them:103*104* \li By index - pa_context_get_sink_input_info() /105* pa_context_get_source_output_info()106* \li All - pa_context_get_sink_input_info_list() /107* pa_context_get_source_output_info_list()108*109* The structure returned is the pa_sink_input_info or pa_source_output_info110* structure.111*112* \subsection samples_subsec Samples113*114* The list of cached samples can be retrieved from the server. Three methods115* exist for querying the sample cache list:116*117* \li By index - pa_context_get_sample_info_by_index()118* \li By name - pa_context_get_sample_info_by_name()119* \li All - pa_context_get_sample_info_list()120*121* Note that this only retrieves information about the sample, not the sample122* data itself.123*124* \subsection module_subsec Driver Modules125*126* PulseAudio driver modules are identified by index and are retrieved using either127* pa_context_get_module_info() or pa_context_get_module_info_list(). The128* information structure is called pa_module_info.129*130* \subsection client_subsec Clients131*132* PulseAudio clients are also identified by index and are retrieved using133* either pa_context_get_client_info() or pa_context_get_client_info_list().134* The information structure is called pa_client_info.135*136* \section ctrl_sec Control137*138* Some parts of the server are only possible to read, but most can also be139* modified in different ways. Note that these changes will affect all140* connected clients and not just the one issuing the request.141*142* \subsection sinksrc_subsec Sinks and Sources143*144* The most common change one would want to apply to sinks and sources is to145* modify the volume of the audio. Identically to how sinks and sources can146* be queried, there are two ways of identifying them:147*148* \li By index - pa_context_set_sink_volume_by_index() /149* pa_context_set_source_volume_by_index()150* \li By name - pa_context_set_sink_volume_by_name() /151* pa_context_set_source_volume_by_name()152*153* It is also possible to mute a sink or source:154*155* \li By index - pa_context_set_sink_mute_by_index() /156* pa_context_set_source_mute_by_index()157* \li By name - pa_context_set_sink_mute_by_name() /158* pa_context_set_source_mute_by_name()159*160* \subsection siso_subsec Sink Inputs and Source Outputs161*162* If an application desires to modify the volume of just a single stream163* (commonly one of its own streams), this can be done by setting the volume164* of its associated sink input or source output, using165* pa_context_set_sink_input_volume() or pa_context_set_source_output_volume().166*167* It is also possible to remove sink inputs and source outputs, terminating168* the streams associated with them:169*170* \li Sink input - pa_context_kill_sink_input()171* \li Source output - pa_context_kill_source_output()172*173* It is strongly recommended that all volume changes are done as a direct174* result of user input. With automated requests, such as those resulting175* from misguided attempts of crossfading, PulseAudio can store the stream176* volume at an inappropriate moment and restore it later. Besides, such177* attempts lead to OSD popups in some desktop environments.178*179* As a special case of the general rule above, it is recommended that your180* application leaves the task of saving and restoring the volume of its181* streams to PulseAudio and does not attempt to do it by itself. PulseAudio182* really knows better about events such as stream moving or headphone183* plugging that would make the volume stored by the application inapplicable184* to the new configuration.185*186* Another important case where setting a sink input volume may be a bad idea187* is related to interpreters that interpret potentially untrusted scripts.188* PulseAudio relies on your application not making malicious requests (such189* as repeatedly setting the volume to 100%). Thus, script interpreters that190* represent a security boundary must sandbox volume-changing requests coming191* from their scripts. In the worst case, it may be necessary to apply the192* script-requested volume to the script-produced sounds by altering the193* samples in the script interpreter and not touching the sink or sink input194* volume as seen by PulseAudio.195*196* If an application changes any volume, it should also listen to changes of197* the same volume originating from outside the application (e.g., from the198* system mixer application) and update its user interface accordingly. Use199* \ref subscribe to get such notifications.200*201* \subsection module_subsec Modules202*203* Server modules can be remotely loaded and unloaded using204* pa_context_load_module() and pa_context_unload_module().205*206* \subsection client_subsec Clients207*208* The only operation supported on clients is the possibility of kicking209* them off the server using pa_context_kill_client().210*/211212/** \file213*214* Routines for daemon introspection.215*216* See also \subpage introspect217*/218219PA_C_DECL_BEGIN220221/** @{ \name Sinks */222223/** Stores information about a specific port of a sink. Please224* note that this structure can be extended as part of evolutionary225* API updates at any time in any new release. \since 0.9.16 */226typedef struct pa_sink_port_info {227const char *name; /**< Name of this port */228const char *description; /**< Description of this port */229uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */230int available; /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */231} pa_sink_port_info;232233/** Stores information about sinks. Please note that this structure234* can be extended as part of evolutionary API updates at any time in235* any new release. */236typedef struct pa_sink_info {237const char *name; /**< Name of the sink */238uint32_t index; /**< Index of the sink */239const char *description; /**< Description of this sink */240pa_sample_spec sample_spec; /**< Sample spec of this sink */241pa_channel_map channel_map; /**< Channel map */242uint32_t owner_module; /**< Index of the owning module of this sink, or PA_INVALID_INDEX. */243pa_cvolume volume; /**< Volume of the sink */244int mute; /**< Mute switch of the sink */245uint32_t monitor_source; /**< Index of the monitor source connected to this sink. */246const char *monitor_source_name; /**< The name of the monitor source. */247pa_usec_t latency; /**< Length of queued audio in the output buffer. */248const char *driver; /**< Driver name */249pa_sink_flags_t flags; /**< Flags */250pa_proplist *proplist; /**< Property list \since 0.9.11 */251pa_usec_t configured_latency; /**< The latency this device has been configured to. \since 0.9.11 */252pa_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 */253pa_sink_state_t state; /**< State \since 0.9.15 */254uint32_t n_volume_steps; /**< Number of volume steps for sinks which do not support arbitrary volumes. \since 0.9.15 */255uint32_t card; /**< Card index, or PA_INVALID_INDEX. \since 0.9.15 */256uint32_t n_ports; /**< Number of entries in port array \since 0.9.16 */257pa_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 */258pa_sink_port_info* active_port; /**< Pointer to active port in the array, or NULL. \since 0.9.16 */259uint8_t n_formats; /**< Number of formats supported by the sink. \since 1.0 */260pa_format_info **formats; /**< Array of formats supported by the sink. \since 1.0 */261} pa_sink_info;262263/** Callback prototype for pa_context_get_sink_info_by_name() and friends */264typedef void (*pa_sink_info_cb_t)(pa_context *c, const pa_sink_info *i, int eol, void *userdata);265266/** Get information about a sink by its name */267pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name, pa_sink_info_cb_t cb, void *userdata);268269/** Get information about a sink by its index */270pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t idx, pa_sink_info_cb_t cb, void *userdata);271272/** Get the complete sink list */273pa_operation* pa_context_get_sink_info_list(pa_context *c, pa_sink_info_cb_t cb, void *userdata);274275/** Set the volume of a sink device specified by its index */276pa_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);277278/** Set the volume of a sink device specified by its name */279pa_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);280281/** Set the mute switch of a sink device specified by its index */282pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);283284/** Set the mute switch of a sink device specified by its name */285pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata);286287/** Suspend/Resume a sink. \since 0.9.7 */288pa_operation* pa_context_suspend_sink_by_name(pa_context *c, const char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata);289290/** Suspend/Resume a sink. If idx is PA_INVALID_INDEX all sinks will be suspended. \since 0.9.7 */291pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata);292293/** Change the profile of a sink. \since 0.9.16 */294pa_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);295296/** Change the profile of a sink. \since 0.9.15 */297pa_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);298299/** @} */300301/** @{ \name Sources */302303/** Stores information about a specific port of a source. Please304* note that this structure can be extended as part of evolutionary305* API updates at any time in any new release. \since 0.9.16 */306typedef struct pa_source_port_info {307const char *name; /**< Name of this port */308const char *description; /**< Description of this port */309uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */310int available; /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */311} pa_source_port_info;312313/** Stores information about sources. Please note that this structure314* can be extended as part of evolutionary API updates at any time in315* any new release. */316typedef struct pa_source_info {317const char *name; /**< Name of the source */318uint32_t index; /**< Index of the source */319const char *description; /**< Description of this source */320pa_sample_spec sample_spec; /**< Sample spec of this source */321pa_channel_map channel_map; /**< Channel map */322uint32_t owner_module; /**< Owning module index, or PA_INVALID_INDEX. */323pa_cvolume volume; /**< Volume of the source */324int mute; /**< Mute switch of the sink */325uint32_t monitor_of_sink; /**< If this is a monitor source, the index of the owning sink, otherwise PA_INVALID_INDEX. */326const char *monitor_of_sink_name; /**< Name of the owning sink, or NULL. */327pa_usec_t latency; /**< Length of filled record buffer of this source. */328const char *driver; /**< Driver name */329pa_source_flags_t flags; /**< Flags */330pa_proplist *proplist; /**< Property list \since 0.9.11 */331pa_usec_t configured_latency; /**< The latency this device has been configured to. \since 0.9.11 */332pa_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 */333pa_source_state_t state; /**< State \since 0.9.15 */334uint32_t n_volume_steps; /**< Number of volume steps for sources which do not support arbitrary volumes. \since 0.9.15 */335uint32_t card; /**< Card index, or PA_INVALID_INDEX. \since 0.9.15 */336uint32_t n_ports; /**< Number of entries in port array \since 0.9.16 */337pa_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 */338pa_source_port_info* active_port; /**< Pointer to active port in the array, or NULL. \since 0.9.16 */339uint8_t n_formats; /**< Number of formats supported by the source. \since 1.0 */340pa_format_info **formats; /**< Array of formats supported by the source. \since 1.0 */341} pa_source_info;342343/** Callback prototype for pa_context_get_source_info_by_name() and friends */344typedef void (*pa_source_info_cb_t)(pa_context *c, const pa_source_info *i, int eol, void *userdata);345346/** Get information about a source by its name */347pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name, pa_source_info_cb_t cb, void *userdata);348349/** Get information about a source by its index */350pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t idx, pa_source_info_cb_t cb, void *userdata);351352/** Get the complete source list */353pa_operation* pa_context_get_source_info_list(pa_context *c, pa_source_info_cb_t cb, void *userdata);354355/** Set the volume of a source device specified by its index */356pa_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);357358/** Set the volume of a source device specified by its name */359pa_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);360361/** Set the mute switch of a source device specified by its index */362pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);363364/** Set the mute switch of a source device specified by its name */365pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata);366367/** Suspend/Resume a source. \since 0.9.7 */368pa_operation* pa_context_suspend_source_by_name(pa_context *c, const char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata);369370/** Suspend/Resume a source. If idx is PA_INVALID_INDEX, all sources will be suspended. \since 0.9.7 */371pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata);372373/** Change the profile of a source. \since 0.9.16 */374pa_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);375376/** Change the profile of a source. \since 0.9.15 */377pa_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);378379/** @} */380381/** @{ \name Server */382383/** Server information. Please note that this structure can be384* extended as part of evolutionary API updates at any time in any new385* release. */386typedef struct pa_server_info {387const char *user_name; /**< User name of the daemon process */388const char *host_name; /**< Host name the daemon is running on */389const char *server_version; /**< Version string of the daemon */390const char *server_name; /**< Server package name (usually "pulseaudio") */391pa_sample_spec sample_spec; /**< Default sample specification */392const char *default_sink_name; /**< Name of default sink. */393const char *default_source_name; /**< Name of default source. */394uint32_t cookie; /**< A random cookie for identifying this instance of PulseAudio. */395pa_channel_map channel_map; /**< Default channel map. \since 0.9.15 */396} pa_server_info;397398/** Callback prototype for pa_context_get_server_info() */399typedef void (*pa_server_info_cb_t) (pa_context *c, const pa_server_info*i, void *userdata);400401/** Get some information about the server */402pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata);403404/** @} */405406/** @{ \name Modules */407408/** Stores information about modules. Please note that this structure409* can be extended as part of evolutionary API updates at any time in410* any new release. */411typedef struct pa_module_info {412uint32_t index; /**< Index of the module */413const char*name, /**< Name of the module */414*argument; /**< Argument string of the module */415uint32_t n_used; /**< Usage counter or PA_INVALID_INDEX */416/** \cond fulldocs */417int auto_unload; /**< \deprecated Non-zero if this is an autoloaded module. */418/** \endcond */419pa_proplist *proplist; /**< Property list \since 0.9.15 */420} pa_module_info;421422/** Callback prototype for pa_context_get_module_info() and friends */423typedef void (*pa_module_info_cb_t) (pa_context *c, const pa_module_info*i, int eol, void *userdata);424425/** Get some information about a module by its index */426pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_info_cb_t cb, void *userdata);427428/** Get the complete list of currently loaded modules */429pa_operation* pa_context_get_module_info_list(pa_context *c, pa_module_info_cb_t cb, void *userdata);430431/** Callback prototype for pa_context_load_module() */432typedef void (*pa_context_index_cb_t)(pa_context *c, uint32_t idx, void *userdata);433434/** Load a module. */435pa_operation* pa_context_load_module(pa_context *c, const char*name, const char *argument, pa_context_index_cb_t cb, void *userdata);436437/** Unload a module. */438pa_operation* pa_context_unload_module(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);439440/** @} */441442/** @{ \name Clients */443444/** Stores information about clients. Please note that this structure445* can be extended as part of evolutionary API updates at any time in446* any new release. */447typedef struct pa_client_info {448uint32_t index; /**< Index of this client */449const char *name; /**< Name of this client */450uint32_t owner_module; /**< Index of the owning module, or PA_INVALID_INDEX. */451const char *driver; /**< Driver name */452pa_proplist *proplist; /**< Property list \since 0.9.11 */453} pa_client_info;454455/** Callback prototype for pa_context_get_client_info() and friends */456typedef void (*pa_client_info_cb_t) (pa_context *c, const pa_client_info*i, int eol, void *userdata);457458/** Get information about a client by its index */459pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_info_cb_t cb, void *userdata);460461/** Get the complete client list */462pa_operation* pa_context_get_client_info_list(pa_context *c, pa_client_info_cb_t cb, void *userdata);463464/** Kill a client. */465pa_operation* pa_context_kill_client(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);466467/** @} */468469/** @{ \name Cards */470471/** \deprecated Superseded by pa_card_profile_info2 \since 0.9.15 */472typedef struct pa_card_profile_info {473const char *name; /**< Name of this profile */474const char *description; /**< Description of this profile */475uint32_t n_sinks; /**< Number of sinks this profile would create */476uint32_t n_sources; /**< Number of sources this profile would create */477uint32_t priority; /**< The higher this value is, the more useful this profile is as a default. */478} pa_card_profile_info;479480/** Stores information about a specific profile of a card. Please481* note that this structure can be extended as part of evolutionary482* API updates at any time in any new release. \since 5.0 */483typedef struct pa_card_profile_info2 {484const char *name; /**< Name of this profile */485const char *description; /**< Description of this profile */486uint32_t n_sinks; /**< Number of sinks this profile would create */487uint32_t n_sources; /**< Number of sources this profile would create */488uint32_t priority; /**< The higher this value is, the more useful this profile is as a default. */489int available;490/**< Is this profile available? If this is zero, meaning "unavailable",491* then it makes no sense to try to activate this profile. If this is492* non-zero, it's still not a guarantee that activating the profile will493* result in anything useful, it just means that the server isn't aware of494* any reason why the profile would definitely be useless. \since 5.0 */495} pa_card_profile_info2;496497/** Stores information about a specific port of a card. Please498* note that this structure can be extended as part of evolutionary499* API updates at any time in any new release. \since 2.0 */500typedef struct pa_card_port_info {501const char *name; /**< Name of this port */502const char *description; /**< Description of this port */503uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */504int available; /**< A #pa_port_available enum, indicating availability status of this port. */505int direction; /**< A #pa_direction enum, indicating the direction of this port. */506uint32_t n_profiles; /**< Number of entries in profile array */507pa_card_profile_info** profiles; /**< \deprecated Superseded by profiles2 */508pa_proplist *proplist; /**< Property list */509int64_t latency_offset; /**< Latency offset of the port that gets added to the sink/source latency when the port is active. \since 3.0 */510pa_card_profile_info2** profiles2; /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. \since 5.0 */511} pa_card_port_info;512513/** Stores information about cards. Please note that this structure514* can be extended as part of evolutionary API updates at any time in515* any new release. \since 0.9.15 */516typedef struct pa_card_info {517uint32_t index; /**< Index of this card */518const char *name; /**< Name of this card */519uint32_t owner_module; /**< Index of the owning module, or PA_INVALID_INDEX. */520const char *driver; /**< Driver name */521uint32_t n_profiles; /**< Number of entries in profile array */522pa_card_profile_info* profiles; /**< \deprecated Superseded by profiles2 */523pa_card_profile_info* active_profile; /**< \deprecated Superseded by active_profile2 */524pa_proplist *proplist; /**< Property list */525uint32_t n_ports; /**< Number of entries in port array */526pa_card_port_info **ports; /**< Array of pointers to ports, or NULL. Array is terminated by an entry set to NULL. */527pa_card_profile_info2** profiles2; /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. \since 5.0 */528pa_card_profile_info2* active_profile2; /**< Pointer to active profile in the array, or NULL. \since 5.0 */529} pa_card_info;530531/** Callback prototype for pa_context_get_card_info_...() \since 0.9.15 */532typedef void (*pa_card_info_cb_t) (pa_context *c, const pa_card_info*i, int eol, void *userdata);533534/** Get information about a card by its index \since 0.9.15 */535pa_operation* pa_context_get_card_info_by_index(pa_context *c, uint32_t idx, pa_card_info_cb_t cb, void *userdata);536537/** Get information about a card by its name \since 0.9.15 */538pa_operation* pa_context_get_card_info_by_name(pa_context *c, const char *name, pa_card_info_cb_t cb, void *userdata);539540/** Get the complete card list \since 0.9.15 */541pa_operation* pa_context_get_card_info_list(pa_context *c, pa_card_info_cb_t cb, void *userdata);542543/** Change the profile of a card. \since 0.9.15 */544pa_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);545546/** Change the profile of a card. \since 0.9.15 */547pa_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);548549/** Set the latency offset of a port. \since 3.0 */550pa_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);551552/** @} */553554/** @{ \name Sink Inputs */555556/** Stores information about sink inputs. Please note that this structure557* can be extended as part of evolutionary API updates at any time in558* any new release. */559typedef struct pa_sink_input_info {560uint32_t index; /**< Index of the sink input */561const char *name; /**< Name of the sink input */562uint32_t owner_module; /**< Index of the module this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any module. */563uint32_t client; /**< Index of the client this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any client. */564uint32_t sink; /**< Index of the connected sink */565pa_sample_spec sample_spec; /**< The sample specification of the sink input. */566pa_channel_map channel_map; /**< Channel map */567pa_cvolume volume; /**< The volume of this sink input. */568pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_timing_info for details. */569pa_usec_t sink_usec; /**< Latency of the sink device, see pa_timing_info for details. */570const char *resample_method; /**< The resampling method used by this sink input. */571const char *driver; /**< Driver name */572int mute; /**< Stream muted \since 0.9.7 */573pa_proplist *proplist; /**< Property list \since 0.9.11 */574int corked; /**< Stream corked \since 1.0 */575int has_volume; /**< Stream has volume. If not set, then the meaning of this struct's volume member is unspecified. \since 1.0 */576int 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 */577pa_format_info *format; /**< Stream format information. \since 1.0 */578} pa_sink_input_info;579580/** Callback prototype for pa_context_get_sink_input_info() and friends */581typedef void (*pa_sink_input_info_cb_t) (pa_context *c, const pa_sink_input_info *i, int eol, void *userdata);582583/** Get some information about a sink input by its index */584pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata);585586/** Get the complete sink input list */587pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata);588589/** Move the specified sink input to a different sink. \since 0.9.5 */590pa_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);591592/** Move the specified sink input to a different sink. \since 0.9.5 */593pa_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);594595/** Set the volume of a sink input stream */596pa_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);597598/** Set the mute switch of a sink input stream \since 0.9.7 */599pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);600601/** Kill a sink input. */602pa_operation* pa_context_kill_sink_input(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);603604/** @} */605606/** @{ \name Source Outputs */607608/** Stores information about source outputs. Please note that this structure609* can be extended as part of evolutionary API updates at any time in610* any new release. */611typedef struct pa_source_output_info {612uint32_t index; /**< Index of the source output */613const char *name; /**< Name of the source output */614uint32_t owner_module; /**< Index of the module this source output belongs to, or PA_INVALID_INDEX when it does not belong to any module. */615uint32_t client; /**< Index of the client this source output belongs to, or PA_INVALID_INDEX when it does not belong to any client. */616uint32_t source; /**< Index of the connected source */617pa_sample_spec sample_spec; /**< The sample specification of the source output */618pa_channel_map channel_map; /**< Channel map */619pa_usec_t buffer_usec; /**< Latency due to buffering in the source output, see pa_timing_info for details. */620pa_usec_t source_usec; /**< Latency of the source device, see pa_timing_info for details. */621const char *resample_method; /**< The resampling method used by this source output. */622const char *driver; /**< Driver name */623pa_proplist *proplist; /**< Property list \since 0.9.11 */624int corked; /**< Stream corked \since 1.0 */625pa_cvolume volume; /**< The volume of this source output \since 1.0 */626int mute; /**< Stream muted \since 1.0 */627int has_volume; /**< Stream has volume. If not set, then the meaning of this struct's volume member is unspecified. \since 1.0 */628int 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 */629pa_format_info *format; /**< Stream format information. \since 1.0 */630} pa_source_output_info;631632/** Callback prototype for pa_context_get_source_output_info() and friends */633typedef void (*pa_source_output_info_cb_t) (pa_context *c, const pa_source_output_info *i, int eol, void *userdata);634635/** Get information about a source output by its index */636pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_source_output_info_cb_t cb, void *userdata);637638/** Get the complete list of source outputs */639pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_output_info_cb_t cb, void *userdata);640641/** Move the specified source output to a different source. \since 0.9.5 */642pa_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);643644/** Move the specified source output to a different source. \since 0.9.5 */645pa_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);646647/** Set the volume of a source output stream \since 1.0 */648pa_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);649650/** Set the mute switch of a source output stream \since 1.0 */651pa_operation* pa_context_set_source_output_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata);652653/** Kill a source output. */654pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata);655656/** @} */657658/** @{ \name Statistics */659660/** Memory block statistics. Please note that this structure661* can be extended as part of evolutionary API updates at any time in662* any new release. */663typedef struct pa_stat_info {664uint32_t memblock_total; /**< Currently allocated memory blocks */665uint32_t memblock_total_size; /**< Current total size of allocated memory blocks */666uint32_t memblock_allocated; /**< Allocated memory blocks during the whole lifetime of the daemon. */667uint32_t memblock_allocated_size; /**< Total size of all memory blocks allocated during the whole lifetime of the daemon. */668uint32_t scache_size; /**< Total size of all sample cache entries. */669} pa_stat_info;670671/** Callback prototype for pa_context_stat() */672typedef void (*pa_stat_info_cb_t) (pa_context *c, const pa_stat_info *i, void *userdata);673674/** Get daemon memory block statistics */675pa_operation* pa_context_stat(pa_context *c, pa_stat_info_cb_t cb, void *userdata);676677/** @} */678679/** @{ \name Cached Samples */680681/** Stores information about sample cache entries. Please note that this structure682* can be extended as part of evolutionary API updates at any time in683* any new release. */684typedef struct pa_sample_info {685uint32_t index; /**< Index of this entry */686const char *name; /**< Name of this entry */687pa_cvolume volume; /**< Default volume of this entry */688pa_sample_spec sample_spec; /**< Sample specification of the sample */689pa_channel_map channel_map; /**< The channel map */690pa_usec_t duration; /**< Duration of this entry */691uint32_t bytes; /**< Length of this sample in bytes. */692int lazy; /**< Non-zero when this is a lazy cache entry. */693const char *filename; /**< In case this is a lazy cache entry, the filename for the sound file to be loaded on demand. */694pa_proplist *proplist; /**< Property list for this sample. \since 0.9.11 */695} pa_sample_info;696697/** Callback prototype for pa_context_get_sample_info_by_name() and friends */698typedef void (*pa_sample_info_cb_t)(pa_context *c, const pa_sample_info *i, int eol, void *userdata);699700/** Get information about a sample by its name */701pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name, pa_sample_info_cb_t cb, void *userdata);702703/** Get information about a sample by its index */704pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, pa_sample_info_cb_t cb, void *userdata);705706/** Get the complete list of samples stored in the daemon. */707pa_operation* pa_context_get_sample_info_list(pa_context *c, pa_sample_info_cb_t cb, void *userdata);708709/** @} */710711/** \cond fulldocs */712713/** @{ \name Autoload Entries */714715/** \deprecated Type of an autoload entry. */716typedef enum pa_autoload_type {717PA_AUTOLOAD_SINK = 0,718PA_AUTOLOAD_SOURCE = 1719} pa_autoload_type_t;720721/** \deprecated Stores information about autoload entries. Please note that this structure722* can be extended as part of evolutionary API updates at any time in723* any new release. */724typedef struct pa_autoload_info {725uint32_t index; /**< Index of this autoload entry */726const char *name; /**< Name of the sink or source */727pa_autoload_type_t type; /**< Type of the autoload entry */728const char *module; /**< Module name to load */729const char *argument; /**< Argument string for module */730} pa_autoload_info;731732/** \deprecated Callback prototype for pa_context_get_autoload_info_by_name() and friends */733typedef void (*pa_autoload_info_cb_t)(pa_context *c, const pa_autoload_info *i, int eol, void *userdata);734735/** \deprecated Get info about a specific autoload entry. */736pa_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;737738/** \deprecated Get info about a specific autoload entry. */739pa_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;740741/** \deprecated Get the complete list of autoload entries. */742pa_operation* pa_context_get_autoload_info_list(pa_context *c, pa_autoload_info_cb_t cb, void *userdata) PA_GCC_DEPRECATED;743744/** \deprecated Add a new autoload entry. */745pa_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;746747/** \deprecated Remove an autoload entry. */748pa_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;749750/** \deprecated Remove an autoload entry. */751pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void* userdata) PA_GCC_DEPRECATED;752753/** @} */754755/** \endcond */756757PA_C_DECL_END758759#endif760761762