* that some implementations may block all other events
* when a deferred event is active.
* \li I/O events - Events that trigger on file descriptor activities.
- * \li Times events - Events that trigger after a fixed ammount of time.
+ * \li Times events - Events that trigger after a fixed amount of time.
*
* The abstraction is represented as a number of function pointers in the
* pa_mainloop_api structure.
*
* To actually be able to use these functions, an implementation needs to
* be coupled to the abstraction. There are three of these shipped with
- * PulseAudio, but any other can be used with a minimal ammount of work,
+ * PulseAudio, but any other can be used with a minimal amount of work,
* provided it supports the three basic events listed above.
*
* The implementations shipped with PulseAudio are:
* Whenever the library creates an object, it will have an initial
* reference count of one. Most of the time, this single reference will be
* sufficient for the application, so all required reference count
- * interaction will be a single call to the objects unref function.
+ * interaction will be a single call to the object's unref function.
*
* \section context_sec Context
*
*/
/** \file
- * Connection contexts for asynchrononous communication with a
+ * Connection contexts for asynchronous communication with a
* server. A pa_context object wraps a connection to a PulseAudio
- * server using its native protocol. */
-
-/** \example pacat.c
- * A playback and recording tool using the asynchronous API */
-
-/** \example paplay.c
- * A sound file playback tool using the asynchronous API, based on libsndfile */
+ * server using its native protocol.
+ *
+ * See also \subpage async
+ */
PA_C_DECL_BEGIN
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, and specify the the initial client property
+ * and an application name, and specify the initial client property
* list. \since 0.9.11 */
pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist);
/** Set a callback function that is called whenever the context status changes */
void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
-/** Set a callback function that is called whenver a meta/policy
+/** Set a callback function that is called whenever a meta/policy
* control event is received. \since 0.9.15 */
void pa_context_set_event_callback(pa_context *p, pa_context_event_cb_t cb, void *userdata);
connect to the default server. This routine may but will not always
return synchronously on error. Use pa_context_set_state_callback() to
be notified when the connection is established. If flags doesn't have
-PA_NOAUTOSPAWN set and no specific server is specified or accessible a
-new daemon is spawned. If api is non-NULL, the functions specified in
-the structure are used when forking a new child process. */
+PA_CONTEXT_NOAUTOSPAWN set and no specific server is specified or
+accessible a new daemon is spawned. If api is non-NULL, the functions
+specified in the structure are used when forking a new child
+process. */
int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
/** Terminate the context connection immediately */
pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
/** Tell the daemon to exit. The returned operation is unlikely to
- * complete succesfully, since the daemon probably died before
+ * complete successfully, since the daemon probably died before
* returning a success notification */
pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata);
* introspection functions, such as pa_context_get_client_info(). \since 0.9.11 */
uint32_t pa_context_get_index(pa_context *s);
+/** Create a new timer event source for the specified time (wrapper
+ * for mainloop->time_new). \since 0.9.16 */
+pa_time_event* pa_context_rttime_new(pa_context *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata);
+
+/** Restart a running or expired timer event source (wrapper for
+ * mainloop->time_restart). \since 0.9.16 */
+void pa_context_rttime_restart(pa_context *c, pa_time_event *e, pa_usec_t usec);
+
+/** Return the optimal block size for passing around audio buffers. It
+ * is recommended to allocate buffers of the size returned here when
+ * writing audio data to playback streams, if the latency constraints
+ * permit this. It is not recommended writing larger blocks than this
+ * because usually they will then be split up internally into chunks
+ * of this size. It is not recommended writing smaller blocks than
+ * this (unless required due to latency demands) because this
+ * increases CPU usage. If ss is NULL you will be returned the
+ * byte-exact tile size. If you pass a valid ss, then the tile size
+ * will be rounded down to multiple of the frame size. This is
+ * supposed to be used in a construct such as
+ * pa_context_get_tile_size(pa_stream_get_context(s),
+ * pa_stream_get_sample_spec(ss)); \since 0.9.20 */
+size_t pa_context_get_tile_size(pa_context *c, const pa_sample_spec *ss);
+
+/** Load the authentication cookie from a file. This function is primarily
+ * meant for PulseAudio's own tunnel modules, which need to load the cookie
+ * from a custom location. Applications don't usually need to care about the
+ * cookie at all, but if it happens that you know what the authentication
+ * cookie is and your application needs to load it from a non-standard
+ * location, feel free to use this function. \since 5.0 */
+int pa_context_load_cookie_from_file(pa_context *c, const char *cookie_file_path);
+
PA_C_DECL_END
#endif