30
28
#include <pulse/mainloop-api.h>
31
29
#include <pulse/cdecl.h>
32
30
#include <pulse/operation.h>
31
#include <pulse/proplist.h>
34
33
/** \page async Asynchronous API
36
35
* \section overv_sec Overview
38
37
* The asynchronous API is the native interface to the PulseAudio library.
39
* It allows full access to all available functions. This also means that
38
* It allows full access to all available functionality. This however means that
40
39
* it is rather complex and can take some time to fully master.
42
41
* \section mainloop_sec Main Loop Abstraction
65
64
* implementation where all of PulseAudio's
66
65
* internal handling runs in a separate
68
* \li \subpage glib-mainloop - A wrapper around GLIB's main loop. Available
69
* for both GLIB 1.2 and GLIB 2.x.
67
* \li \subpage glib-mainloop - A wrapper around GLib's main loop.
71
69
* UNIX signals may be hooked to a main loop using the functions from
72
70
* \ref mainloop-signal.h. These rely only on the main loop abstraction
166
164
typedef void (*pa_context_success_cb_t) (pa_context *c, int success, void *userdata);
168
166
/** Instantiate a new connection context with an abstract mainloop API
169
* and an application name */
167
* and an application name. It is recommended to use pa_context_new_with_proplist()
168
* instead and specify some initial properties.*/
170
169
pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name);
171
/** Instantiate a new connection context with an abstract mainloop API
172
* and an application name, and specify the the initial client property
173
* list. \since 0.9.11 */
174
pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist);
172
176
/** Decrease the reference counter of the context by one */
173
177
void pa_context_unref(pa_context *c);
207
211
* returning a success notification */
208
212
pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata);
210
/** Set the name of the default sink. \since 0.4 */
214
/** Set the name of the default sink. */
211
215
pa_operation* pa_context_set_default_sink(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
213
/** Set the name of the default source. \since 0.4 */
217
/** Set the name of the default source. */
214
218
pa_operation* pa_context_set_default_source(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
216
/** Returns 1 when the connection is to a local daemon. Returns negative when no connection has been made yet. \since 0.5 */
220
/** Returns 1 when the connection is to a local daemon. Returns negative when no connection has been made yet. */
217
221
int pa_context_is_local(pa_context *c);
219
/** Set a different application name for context on the server. \since 0.5 */
223
/** Set a different application name for context on the server. */
220
224
pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
222
/** Return the server name this context is connected to. \since 0.7 */
226
/** Return the server name this context is connected to. */
223
227
const char* pa_context_get_server(pa_context *c);
225
/** Return the protocol version of the library. \since 0.8 */
229
/** Return the protocol version of the library. */
226
230
uint32_t pa_context_get_protocol_version(pa_context *c);
228
/** Return the protocol version of the connected server. \since 0.8 */
232
/** Return the protocol version of the connected server. */
229
233
uint32_t pa_context_get_server_protocol_version(pa_context *c);
235
/* Update the property list of the client, adding new entries. Please
236
* note that it is highly recommended to set as much properties
237
* initially via pa_context_new_with_proplist() as possible instead a
238
* posteriori with this function, since that information may then be
239
* used to route streams of the client to the right device. \since 0.9.11 */
240
pa_operation *pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, pa_proplist *p, pa_context_success_cb_t cb, void *userdata);
242
/* Update the property list of the client, remove entries. \since 0.9.11 */
243
pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[], pa_context_success_cb_t cb, void *userdata);
245
/** Return the client index this context is
246
* identified in the server with. This is useful for usage with the
247
* introspection functions, such as pa_context_get_client_info(). \since 0.9.11 */
248
uint32_t pa_context_get_index(pa_context *s);