PulseAudio 16.1

context.h
Go to the documentation of this file.
1#ifndef foocontexthfoo
2#define foocontexthfoo
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 <pulse/sample.h>
25#include <pulse/def.h>
26#include <pulse/mainloop-api.h>
27#include <pulse/cdecl.h>
28#include <pulse/operation.h>
29#include <pulse/proplist.h>
30#include <pulse/version.h>
31
151PA_C_DECL_BEGIN
152
154 typedef struct pa_context pa_context;
155
157 typedef void (*pa_context_notify_cb_t)(pa_context *c, void *userdata);
158
160 typedef void (*pa_context_success_cb_t) (pa_context *c, int success, void *userdata);
161
167 typedef void (*pa_context_event_cb_t)(pa_context *c, const char *name, pa_proplist *p, void *userdata);
168
172 pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name);
173
177 pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, const pa_proplist *proplist);
178
180 void pa_context_unref(pa_context *c);
181
183 pa_context* pa_context_ref(pa_context *c);
184
186 void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
187
190 void pa_context_set_event_callback(pa_context *p, pa_context_event_cb_t cb, void *userdata);
191
193 int pa_context_errno(const pa_context *c);
194
196 int pa_context_is_pending(const pa_context *c);
197
199 pa_context_state_t pa_context_get_state(const pa_context *c);
200
210 int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
211
213 void pa_context_disconnect(pa_context *c);
214
216 pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
217
221 pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata);
222
224 pa_operation* pa_context_set_default_sink(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
225
227 pa_operation* pa_context_set_default_source(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
228
230 int pa_context_is_local(const pa_context *c);
231
233 pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
234
236 const char* pa_context_get_server(const pa_context *c);
237
239uint32_t pa_context_get_protocol_version(const pa_context *c);
240
243uint32_t pa_context_get_server_protocol_version(const pa_context *c);
244
250 pa_operation *pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, const pa_proplist *p, pa_context_success_cb_t cb, void *userdata);
251
253 pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[], pa_context_success_cb_t cb, void *userdata);
254
259uint32_t pa_context_get_index(const pa_context *s);
260
263 pa_time_event* pa_context_rttime_new(const pa_context *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata);
264
267 void pa_context_rttime_restart(const pa_context *c, pa_time_event *e, pa_usec_t usec);
268
283 size_t pa_context_get_tile_size(const pa_context *c, const pa_sample_spec *ss);
284
291 int pa_context_load_cookie_from_file(pa_context *c, const char *cookie_file_path);
292
293PA_C_DECL_END
294
295#endif
pa_context_event_cb_t
void(* pa_context_event_cb_t)(pa_context *c, const char *name, pa_proplist *p, void *userdata)
A callback for asynchronous meta/policy event messages.
Definition: context.h:167
pa_context_success_cb_t
void(* pa_context_success_cb_t)(pa_context *c, int success, void *userdata)
A generic callback for operation completion.
Definition: context.h:160
pa_context_set_default_sink
pa_operation * pa_context_set_default_sink(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
Set the name of the default sink.
pa_context_disconnect
void pa_context_disconnect(pa_context *c)
Terminate the context connection immediately.
pa_context_notify_cb_t
void(* pa_context_notify_cb_t)(pa_context *c, void *userdata)
Generic notification callback prototype.
Definition: context.h:157
pa_context_is_local
int pa_context_is_local(const pa_context *c)
Returns 1 when the connection is to a local daemon.
pa_context_new_with_proplist
pa_context * pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, const pa_proplist *proplist)
Instantiate a new connection context with an abstract mainloop API and an application name,...
pa_context_drain
pa_operation * pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata)
Drain the context.
pa_context_unref
void pa_context_unref(pa_context *c)
Decrease the reference counter of the context by one.
pa_context_new
pa_context * pa_context_new(pa_mainloop_api *mainloop, const char *name)
Instantiate a new connection context with an abstract mainloop API and an application name.
pa_context_get_protocol_version
uint32_t pa_context_get_protocol_version(const pa_context *c)
Return the protocol version of the library.
pa_context_set_default_source
pa_operation * pa_context_set_default_source(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
Set the name of the default source.
pa_context_is_pending
int pa_context_is_pending(const pa_context *c)
Return non-zero if some data is pending to be written to the connection.
pa_context_rttime_new
pa_time_event * pa_context_rttime_new(const pa_context *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata)
Create a new timer event source for the specified time (wrapper for mainloop->time_new).
pa_context_proplist_update
pa_operation * pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, const pa_proplist *p, pa_context_success_cb_t cb, void *userdata)
Update the property list of the client, adding new entries.
pa_context_load_cookie_from_file
int pa_context_load_cookie_from_file(pa_context *c, const char *cookie_file_path)
Load the authentication cookie from a file.
pa_context_rttime_restart
void pa_context_rttime_restart(const pa_context *c, pa_time_event *e, pa_usec_t usec)
Restart a running or expired timer event source (wrapper for mainloop->time_restart).
pa_context_ref
pa_context * pa_context_ref(pa_context *c)
Increase the reference counter of the context by one.
pa_context_errno
int pa_context_errno(const pa_context *c)
Return the error number of the last failed operation.
pa_context_connect
int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api)
Connect the context to the specified server.
pa_context_get_server_protocol_version
uint32_t pa_context_get_server_protocol_version(const pa_context *c)
Return the protocol version of the connected server.
pa_context_get_index
uint32_t pa_context_get_index(const pa_context *s)
Return the client index this context is identified in the server with.
pa_context_get_tile_size
size_t pa_context_get_tile_size(const pa_context *c, const pa_sample_spec *ss)
Return the optimal block size for passing around audio buffers.
pa_context_set_event_callback
void pa_context_set_event_callback(pa_context *p, pa_context_event_cb_t cb, void *userdata)
Set a callback function that is called whenever a meta/policy control event is received.
pa_context_proplist_remove
pa_operation * pa_context_proplist_remove(pa_context *c, const char *const keys[], pa_context_success_cb_t cb, void *userdata)
Update the property list of the client, remove entries.
pa_context_exit_daemon
pa_operation * pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata)
Tell the daemon to exit.
pa_context_get_state
pa_context_state_t pa_context_get_state(const pa_context *c)
Return the current context status.
pa_context_get_server
const char * pa_context_get_server(const pa_context *c)
Return the server name this context is connected to.
pa_context_set_state_callback
void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata)
Set a callback function that is called whenever the context status changes.
pa_context_set_name
pa_operation * pa_context_set_name(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
Set a different application name for context on the server.
pa_context
struct pa_context pa_context
An opaque connection context to a daemon.
Definition: context.h:154
def.h
Global definitions.
pa_context_flags_t
enum pa_context_flags pa_context_flags_t
Some special flags for contexts.
pa_context_state_t
enum pa_context_state pa_context_state_t
The state of a connection context.
mainloop-api.h
Main loop abstraction layer.
pa_time_event
struct pa_time_event pa_time_event
An opaque timer event source object.
Definition: mainloop-api.h:73
pa_time_event_cb_t
void(* pa_time_event_cb_t)(pa_mainloop_api *a, pa_time_event *e, const struct timeval *tv, void *userdata)
A time event callback prototype.
Definition: mainloop-api.h:75
operation.h
Asynchronous operations.
pa_operation
struct pa_operation pa_operation
An asynchronous operation object.
Definition: operation.h:33
proplist.h
Property list constants and functions.
pa_update_mode_t
enum pa_update_mode pa_update_mode_t
Update mode enum for pa_proplist_update().
pa_proplist
struct pa_proplist pa_proplist
A property list object.
Definition: proplist.h:278
sample.h
Constants and routines for sample type handling.
pa_usec_t
uint64_t pa_usec_t
Type for usec specifications (unsigned).
Definition: sample.h:264
pa_mainloop_api
An abstract mainloop API vtable.
Definition: mainloop-api.h:87
pa_sample_spec
A sample format and attribute specification.
Definition: sample.h:252
pa_spawn_api
A structure for the spawn api.
Definition: def.h:757