Path: blob/master/thirdparty/linuxbsd_headers/pulse/pulseaudio.h
9905 views
#ifndef foopulseaudiohfoo1#define foopulseaudiohfoo23/***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 as11published by the Free Software Foundation; either version 2.1 of the12License, or (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 GNU17Lesser General Public License for more details.1819You should have received a copy of the GNU Lesser General Public20License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.21***/2223#include <pulse/direction.h>24#include <pulse/mainloop-api.h>25#include <pulse/sample.h>26#include <pulse/format.h>27#include <pulse/def.h>28#include <pulse/context.h>29#include <pulse/stream.h>30#include <pulse/introspect.h>31#include <pulse/subscribe.h>32#include <pulse/scache.h>33#include <pulse/version.h>34#include <pulse/error.h>35#include <pulse/operation.h>36#include <pulse/channelmap.h>37#include <pulse/volume.h>38#include <pulse/xmalloc.h>39#include <pulse/utf8.h>40#include <pulse/thread-mainloop.h>41#include <pulse/mainloop.h>42#include <pulse/mainloop-signal.h>43#include <pulse/util.h>44#include <pulse/timeval.h>45#include <pulse/proplist.h>46#include <pulse/rtclock.h>4748/** \file49* Include all libpulse header files at once. The following files are50* included: \ref direction.h, \ref mainloop-api.h, \ref sample.h, \ref def.h,51* \ref context.h, \ref stream.h, \ref introspect.h, \ref subscribe.h, \ref52* scache.h, \ref version.h, \ref error.h, \ref channelmap.h, \ref53* operation.h,\ref volume.h, \ref xmalloc.h, \ref utf8.h, \ref54* thread-mainloop.h, \ref mainloop.h, \ref util.h, \ref proplist.h,55* \ref timeval.h, \ref rtclock.h and \ref mainloop-signal.h at56* once */5758/** \mainpage59*60* \section intro_sec Introduction61*62* This document describes the client API for the PulseAudio sound63* server. The API comes in two flavours to accommodate different styles64* of applications and different needs in complexity:65*66* \li The complete but somewhat complicated to use asynchronous API67* \li The simplified, easy to use, but limited synchronous API68*69* All strings in PulseAudio are in the UTF-8 encoding, regardless of current70* locale. Some functions will filter invalid sequences from the string, some71* will simply fail. To ensure reliable behaviour, make sure everything you72* pass to the API is already in UTF-8.7374* \section simple_sec Simple API75*76* Use this if you develop your program in synchronous style and just77* need a way to play or record data on the sound server. See78* \subpage simple for more details.79*80* \section async_sec Asynchronous API81*82* Use this if you develop your programs in asynchronous, event loop83* based style or if you want to use the advanced features of the84* PulseAudio API. A guide can be found in \subpage async.85*86* By using the built-in threaded main loop, it is possible to achieve a87* pseudo-synchronous API, which can be useful in synchronous applications88* where the simple API is insufficient. See the \ref async page for89* details.90*91* \section thread_sec Threads92*93* The PulseAudio client libraries are not designed to be directly94* thread-safe. They are however designed to be reentrant and95* threads-aware.96*97* To use the libraries in a threaded environment, you must assure that98* all objects are only used in one thread at a time. Normally, this means99* that all objects belonging to a single context must be accessed from the100* same thread.101*102* The included main loop implementation is also not thread safe. Take care103* to make sure event objects are not manipulated when any other code is104* using the main loop.105*106* \section error_sec Error Handling107*108* Every function should explicitly document how errors are reported to109* the caller. Unfortunately, currently a lot of that documentation is110* missing. Here is an overview of the general conventions used.111*112* The PulseAudio API indicates error conditions by returning a negative113* integer value or a NULL pointer. On success, zero or a positive integer114* value or a valid pointer is returned.115*116* Functions of the \ref simple generally return -1 or NULL on failure and117* can optionally store an error code (see ::pa_error_code) using a pointer118* argument.119*120* Functions of the \ref async return an negative error code or NULL on121* failure (see ::pa_error_code). In the later case, pa_context_errno()122* can be used to obtain the error code of the last failed operation.123*124* An error code can be turned into a human readable message using125* pa_strerror().126*127* \section logging_sec Logging128*129* You can configure different logging parameters for the PulseAudio client130* libraries. The following environment variables are recognized:131*132* - `PULSE_LOG`: Maximum log level required. Bigger values result in a133* more verbose logging output. The following values are recognized:134* + `0`: Error messages135* + `1`: Warning messages136* + `2`: Notice messages137* + `3`: Info messages138* + `4`: Debug messages139* - `PULSE_LOG_SYSLOG`: If defined, force all client libraries to log140* their output using the syslog(3) mechanism. Default behavior is to141* log all output to stderr.142* - `PULSE_LOG_JOURNAL`: If defined, force all client libraries to log143* their output using the systemd journal. If both `PULSE_LOG_JOURNAL`144* and `PULSE_LOG_SYSLOG` are defined, logging to the systemd journal145* takes a higher precedence. Each message originating library file name146* and function are included by default through the journal fields147* `CODE_FILE`, `CODE_FUNC`, and `CODE_LINE`. Any backtrace attached to148* the logging message is sent through the PulseAudio-specific journal149* field `PULSE_BACKTRACE`. This environment variable has no effect if150* PulseAudio was compiled without systemd journal support.151* - `PULSE_LOG_COLORS`: If defined, enables colored logging output.152* - `PULSE_LOG_TIME`: If defined, include timestamps with each message.153* - `PULSE_LOG_FILE`: If defined, include each message originating file154* name.155* - `PULSE_LOG_META`: If defined, include each message originating file156* name and path relative to the PulseAudio source tree root.157* - `PULSE_LOG_LEVEL`: If defined, include a log level prefix with each158* message. Respectively, the prefixes "E", "W", "N", "I", "D" stands159* for Error, Warning, Notice, Info, and Debugging.160* - `PULSE_LOG_BACKTRACE`: Number of functions to display in the backtrace.161* If this variable is not defined, or has a value of zero, no backtrace162* is shown.163* - `PULSE_LOG_BACKTRACE_SKIP`: Number of backtrace levels to skip, from164* the function printing the log message downwards.165* - `PULSE_LOG_NO_RATE_LIMIT`: If defined, do not rate limit the logging166* output. Rate limiting skips certain log messages when their frequency167* is considered too high.168*169* \section pkgconfig pkg-config170*171* The PulseAudio libraries provide pkg-config snippets for the different172* modules:173*174* \li libpulse - The asynchronous API and the internal main loop implementation.175* \li libpulse-mainloop-glib - GLIB 2.x main loop bindings.176* \li libpulse-simple - The simple PulseAudio API.177*/178179#endif180181182