]> code.delx.au - pulseaudio/blob - src/pulse/pulseaudio.h
21b7213f8635a3f2fc1bc1689cdb801b2da619a7
[pulseaudio] / src / pulse / pulseaudio.h
1 #ifndef foopulseaudiohfoo
2 #define foopulseaudiohfoo
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
12 published by the Free Software Foundation; either version 2.1 of the
13 License, 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 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with PulseAudio; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 USA.
24 ***/
25
26 #include <pulse/mainloop-api.h>
27 #include <pulse/sample.h>
28 #include <pulse/format.h>
29 #include <pulse/def.h>
30 #include <pulse/context.h>
31 #include <pulse/stream.h>
32 #include <pulse/introspect.h>
33 #include <pulse/subscribe.h>
34 #include <pulse/scache.h>
35 #include <pulse/version.h>
36 #include <pulse/error.h>
37 #include <pulse/operation.h>
38 #include <pulse/channelmap.h>
39 #include <pulse/volume.h>
40 #include <pulse/xmalloc.h>
41 #include <pulse/utf8.h>
42 #include <pulse/thread-mainloop.h>
43 #include <pulse/mainloop.h>
44 #include <pulse/mainloop-signal.h>
45 #include <pulse/util.h>
46 #include <pulse/timeval.h>
47 #include <pulse/proplist.h>
48 #include <pulse/rtclock.h>
49
50 /** \file
51 * Include all libpulse header files at once. The following files are
52 * included: \ref mainloop-api.h, \ref sample.h, \ref def.h, \ref
53 * context.h, \ref stream.h, \ref introspect.h, \ref subscribe.h, \ref
54 * scache.h, \ref version.h, \ref error.h, \ref channelmap.h, \ref
55 * operation.h,\ref volume.h, \ref xmalloc.h, \ref utf8.h, \ref
56 * thread-mainloop.h, \ref mainloop.h, \ref util.h, \ref proplist.h,
57 * \ref timeval.h, \ref rtclock.h and \ref mainloop-signal.h at
58 * once */
59
60 /** \mainpage
61 *
62 * \section intro_sec Introduction
63 *
64 * This document describes the client API for the PulseAudio sound
65 * server. The API comes in two flavours to accommodate different styles
66 * of applications and different needs in complexity:
67 *
68 * \li The complete but somewhat complicated to use asynchronous API
69 * \li The simplified, easy to use, but limited synchronous API
70 *
71 * All strings in PulseAudio are in the UTF-8 encoding, regardless of current
72 * locale. Some functions will filter invalid sequences from the string, some
73 * will simply fail. To ensure reliable behaviour, make sure everything you
74 * pass to the API is already in UTF-8.
75
76 * \section simple_sec Simple API
77 *
78 * Use this if you develop your program in synchronous style and just
79 * need a way to play or record data on the sound server. See
80 * \subpage simple for more details.
81 *
82 * \section async_sec Asynchronous API
83 *
84 * Use this if you develop your programs in asynchronous, event loop
85 * based style or if you want to use the advanced features of the
86 * PulseAudio API. A guide can be found in \subpage async.
87 *
88 * By using the built-in threaded main loop, it is possible to achieve a
89 * pseudo-synchronous API, which can be useful in synchronous applications
90 * where the simple API is insufficient. See the \ref async page for
91 * details.
92 *
93 * \section thread_sec Threads
94 *
95 * The PulseAudio client libraries are not designed to be directly
96 * thread-safe. They are however designed to be reentrant and
97 * threads-aware.
98 *
99 * To use the libraries in a threaded environment, you must assure that
100 * all objects are only used in one thread at a time. Normally, this means
101 * that all objects belonging to a single context must be accessed from the
102 * same thread.
103 *
104 * The included main loop implementation is also not thread safe. Take care
105 * to make sure event objects are not manipulated when any other code is
106 * using the main loop.
107 *
108 * \section error_sec Error Handling
109 *
110 * Every function should explicitly document how errors are reported to
111 * the caller. Unfortunately, currently a lot of that documentation is
112 * missing. Here is an overview of the general conventions used.
113 *
114 * The PulseAudio API indicates error conditions by returning a negative
115 * integer value or a NULL pointer. On success, zero or a positive integer
116 * value or a valid pointer is returned.
117 *
118 * Functions of the \ref simple generally return -1 or NULL on failure and
119 * can optionally store an error code (see ::pa_error_code) using a pointer
120 * argument.
121 *
122 * Functions of the \ref async return an negative error code or NULL on
123 * failure (see ::pa_error_code). In the later case, pa_context_errno()
124 * can be used to obtain the error code of the last failed operation.
125 *
126 * An error code can be turned into a human readable message using
127 * pa_strerror().
128 *
129 * \section pkgconfig pkg-config
130 *
131 * The PulseAudio libraries provide pkg-config snippets for the different
132 * modules:
133 *
134 * \li libpulse - The asynchronous API and the internal main loop implementation.
135 * \li libpulse-mainloop-glib - GLIB 2.x main loop bindings.
136 * \li libpulse-simple - The simple PulseAudio API.
137 */
138
139 #endif