godot/thirdparty/linuxbsd_headers/pulse/def.h

#ifndef foodefhfoo
#define foodefhfoo

/***
  This file is part of PulseAudio.

  Copyright 2004-2006 Lennart Poettering
  Copyright 2006 Pierre Ossman <[email protected]> for Cendio AB

  PulseAudio is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2.1 of the
  License, or (at your option) any later version.

  PulseAudio is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
***/

#include <inttypes.h>
#include <sys/time.h>

#include <pulse/cdecl.h>
#include <pulse/sample.h>
#include <pulse/version.h>

/** \file
 * Global definitions */

PA_C_DECL_BEGIN

/** The state of a connection context */
pa_context_state_t;

/** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */
static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {}

/** \cond fulldocs */
#define PA_CONTEXT_UNCONNECTED
#define PA_CONTEXT_CONNECTING
#define PA_CONTEXT_AUTHORIZING
#define PA_CONTEXT_SETTING_NAME
#define PA_CONTEXT_READY
#define PA_CONTEXT_FAILED
#define PA_CONTEXT_TERMINATED
#define PA_CONTEXT_IS_GOOD
/** \endcond */

/** The state of a stream */
pa_stream_state_t;

/** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */
static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {}

/** \cond fulldocs */
#define PA_STREAM_UNCONNECTED
#define PA_STREAM_CREATING
#define PA_STREAM_READY
#define PA_STREAM_FAILED
#define PA_STREAM_TERMINATED
#define PA_STREAM_IS_GOOD
/** \endcond */

/** The state of an operation */
pa_operation_state_t;

/** \cond fulldocs */
#define PA_OPERATION_RUNNING
#define PA_OPERATION_DONE
#define PA_OPERATION_CANCELED
#define PA_OPERATION_CANCELLED
/** \endcond */

/** An invalid index */
#define PA_INVALID_INDEX

/** Some special flags for contexts. */
pa_context_flags_t;

/** \cond fulldocs */
/* Allow clients to check with #ifdef for those flags */
#define PA_CONTEXT_NOAUTOSPAWN
#define PA_CONTEXT_NOFAIL
/** \endcond */

/** Direction bitfield - while we currently do not expose anything bidirectional,
  one should test against the bit instead of the value (e.g.\ if (d & PA_DIRECTION_OUTPUT)),
  because we might add bidirectional stuff in the future. \since 2.0
*/
pa_direction_t;

/** \cond fulldocs */
#define PA_DIRECTION_OUTPUT
#define PA_DIRECTION_INPUT
/** \endcond */

/** The type of device we are dealing with */
pa_device_type_t;

/** \cond fulldocs */
#define PA_DEVICE_TYPE_SINK
#define PA_DEVICE_TYPE_SOURCE
/** \endcond */

/** The direction of a pa_stream object */
pa_stream_direction_t;

/** \cond fulldocs */
#define PA_STREAM_NODIRECTION
#define PA_STREAM_PLAYBACK
#define PA_STREAM_RECORD
#define PA_STREAM_UPLOAD
/** \endcond */

/** Some special flags for stream connections. */
pa_stream_flags_t;

/** \cond fulldocs */

/* English is an evil language */
#define PA_STREAM_NOT_MONOTONOUS

/* Allow clients to check with #ifdef for those flags */
#define PA_STREAM_START_CORKED
#define PA_STREAM_INTERPOLATE_TIMING
#define PA_STREAM_NOT_MONOTONIC
#define PA_STREAM_AUTO_TIMING_UPDATE
#define PA_STREAM_NO_REMAP_CHANNELS
#define PA_STREAM_NO_REMIX_CHANNELS
#define PA_STREAM_FIX_FORMAT
#define PA_STREAM_FIX_RATE
#define PA_STREAM_FIX_CHANNELS
#define PA_STREAM_DONT_MOVE
#define PA_STREAM_VARIABLE_RATE
#define PA_STREAM_PEAK_DETECT
#define PA_STREAM_START_MUTED
#define PA_STREAM_ADJUST_LATENCY
#define PA_STREAM_EARLY_REQUESTS
#define PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
#define PA_STREAM_START_UNMUTED
#define PA_STREAM_FAIL_ON_SUSPEND
#define PA_STREAM_RELATIVE_VOLUME
#define PA_STREAM_PASSTHROUGH

/** \endcond */

/** Playback and record buffer metrics */
pa_buffer_attr;

/** Error values as used by pa_context_errno(). Use pa_strerror() to convert these values to human readable strings */
pa_error_code_t;

/** \cond fulldocs */
#define PA_OK
#define PA_ERR_ACCESS
#define PA_ERR_COMMAND
#define PA_ERR_INVALID
#define PA_ERR_EXIST
#define PA_ERR_NOENTITY
#define PA_ERR_CONNECTIONREFUSED
#define PA_ERR_PROTOCOL
#define PA_ERR_TIMEOUT
#define PA_ERR_AUTHKEY
#define PA_ERR_INTERNAL
#define PA_ERR_CONNECTIONTERMINATED
#define PA_ERR_KILLED
#define PA_ERR_INVALIDSERVER
#define PA_ERR_MODINITFAILED
#define PA_ERR_BADSTATE
#define PA_ERR_NODATA
#define PA_ERR_VERSION
#define PA_ERR_TOOLARGE
#define PA_ERR_NOTSUPPORTED
#define PA_ERR_UNKNOWN
#define PA_ERR_NOEXTENSION
#define PA_ERR_OBSOLETE
#define PA_ERR_NOTIMPLEMENTED
#define PA_ERR_FORKED
#define PA_ERR_MAX
/** \endcond */

/** Subscription event mask, as used by pa_context_subscribe() */
pa_subscription_mask_t;

/** Subscription event types, as used by pa_context_subscribe() */
pa_subscription_event_type_t;

/** Return one if an event type t matches an event mask bitfield */
#define pa_subscription_match_flags(m, t)

/** \cond fulldocs */
#define PA_SUBSCRIPTION_MASK_NULL
#define PA_SUBSCRIPTION_MASK_SINK
#define PA_SUBSCRIPTION_MASK_SOURCE
#define PA_SUBSCRIPTION_MASK_SINK_INPUT
#define PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT
#define PA_SUBSCRIPTION_MASK_MODULE
#define PA_SUBSCRIPTION_MASK_CLIENT
#define PA_SUBSCRIPTION_MASK_SAMPLE_CACHE
#define PA_SUBSCRIPTION_MASK_SERVER
#define PA_SUBSCRIPTION_MASK_AUTOLOAD
#define PA_SUBSCRIPTION_MASK_CARD
#define PA_SUBSCRIPTION_MASK_ALL
#define PA_SUBSCRIPTION_EVENT_SINK
#define PA_SUBSCRIPTION_EVENT_SOURCE
#define PA_SUBSCRIPTION_EVENT_SINK_INPUT
#define PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT
#define PA_SUBSCRIPTION_EVENT_MODULE
#define PA_SUBSCRIPTION_EVENT_CLIENT
#define PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE
#define PA_SUBSCRIPTION_EVENT_SERVER
#define PA_SUBSCRIPTION_EVENT_AUTOLOAD
#define PA_SUBSCRIPTION_EVENT_CARD
#define PA_SUBSCRIPTION_EVENT_FACILITY_MASK
#define PA_SUBSCRIPTION_EVENT_NEW
#define PA_SUBSCRIPTION_EVENT_CHANGE
#define PA_SUBSCRIPTION_EVENT_REMOVE
#define PA_SUBSCRIPTION_EVENT_TYPE_MASK
/** \endcond */

/** A structure for all kinds of timing information of a stream. See
 * pa_stream_update_timing_info() and pa_stream_get_timing_info(). The
 * total output latency a sample that is written with
 * pa_stream_write() takes to be played may be estimated by
 * sink_usec+buffer_usec+transport_usec. (where buffer_usec is defined
 * as pa_bytes_to_usec(write_index-read_index)) The output buffer
 * which buffer_usec relates to may be manipulated freely (with
 * pa_stream_write()'s seek argument, pa_stream_flush() and friends),
 * the buffers sink_usec and source_usec relate to are first-in
 * first-out (FIFO) buffers which cannot be flushed or manipulated in
 * any way. The total input latency a sample that is recorded takes to
 * be delivered to the application is:
 * source_usec+buffer_usec+transport_usec-sink_usec. (Take care of
 * sign issues!) When connected to a monitor source sink_usec contains
 * the latency of the owning sink. The two latency estimations
 * described here are implemented in pa_stream_get_latency(). Please
 * note that this structure can be extended as part of evolutionary
 * API updates at any time in any new release.*/
pa_timing_info;

/** A structure for the spawn api. This may be used to integrate auto
 * spawned daemons into your application. For more information see
 * pa_context_connect(). When spawning a new child process the
 * waitpid() is used on the child's PID. The spawn routine will not
 * block or ignore SIGCHLD signals, since this cannot be done in a
 * thread compatible way. You might have to do this in
 * prefork/postfork. */
pa_spawn_api;

/** Seek type for pa_stream_write(). */
pa_seek_mode_t;

/** \cond fulldocs */
#define PA_SEEK_RELATIVE
#define PA_SEEK_ABSOLUTE
#define PA_SEEK_RELATIVE_ON_READ
#define PA_SEEK_RELATIVE_END
/** \endcond */

/** Special sink flags. */
pa_sink_flags_t;

/** \cond fulldocs */
#define PA_SINK_HW_VOLUME_CTRL
#define PA_SINK_LATENCY
#define PA_SINK_HARDWARE
#define PA_SINK_NETWORK
#define PA_SINK_HW_MUTE_CTRL
#define PA_SINK_DECIBEL_VOLUME
#define PA_SINK_FLAT_VOLUME
#define PA_SINK_DYNAMIC_LATENCY
#define PA_SINK_SET_FORMATS
#ifdef __INCLUDED_FROM_PULSE_AUDIO
#define PA_SINK_CLIENT_FLAGS_MASK
#endif

/** \endcond */

/** Sink state. \since 0.9.15 */
pa_sink_state_t;

/** Returns non-zero if sink is playing: running or idle. \since 0.9.15 */
static inline int PA_SINK_IS_OPENED(pa_sink_state_t x) {}

/** Returns non-zero if sink is running. \since 1.0 */
static inline int PA_SINK_IS_RUNNING(pa_sink_state_t x) {}

/** \cond fulldocs */
#define PA_SINK_INVALID_STATE
#define PA_SINK_RUNNING
#define PA_SINK_IDLE
#define PA_SINK_SUSPENDED
#define PA_SINK_INIT
#define PA_SINK_UNLINKED
#define PA_SINK_IS_OPENED
/** \endcond */

/** Special source flags.  */
pa_source_flags_t;

/** \cond fulldocs */
#define PA_SOURCE_HW_VOLUME_CTRL
#define PA_SOURCE_LATENCY
#define PA_SOURCE_HARDWARE
#define PA_SOURCE_NETWORK
#define PA_SOURCE_HW_MUTE_CTRL
#define PA_SOURCE_DECIBEL_VOLUME
#define PA_SOURCE_DYNAMIC_LATENCY
#define PA_SOURCE_FLAT_VOLUME
#ifdef __INCLUDED_FROM_PULSE_AUDIO
#define PA_SOURCE_CLIENT_FLAGS_MASK
#endif

/** \endcond */

/** Source state. \since 0.9.15 */
pa_source_state_t;

/** Returns non-zero if source is recording: running or idle. \since 0.9.15 */
static inline int PA_SOURCE_IS_OPENED(pa_source_state_t x) {}

/** Returns non-zero if source is running \since 1.0 */
static inline int PA_SOURCE_IS_RUNNING(pa_source_state_t x) {}

/** \cond fulldocs */
#define PA_SOURCE_INVALID_STATE
#define PA_SOURCE_RUNNING
#define PA_SOURCE_IDLE
#define PA_SOURCE_SUSPENDED
#define PA_SOURCE_INIT
#define PA_SOURCE_UNLINKED
#define PA_SOURCE_IS_OPENED
/** \endcond */

/** A generic free() like callback prototype */
pa_free_cb_t;

/** A stream policy/meta event requesting that an application should
 * cork a specific stream. See pa_stream_event_cb_t for more
 * information. \since 0.9.15 */
#define PA_STREAM_EVENT_REQUEST_CORK

/** A stream policy/meta event requesting that an application should
 * cork a specific stream. See pa_stream_event_cb_t for more
 * information, \since 0.9.15 */
#define PA_STREAM_EVENT_REQUEST_UNCORK

/** A stream event notifying that the stream is going to be
 * disconnected because the underlying sink changed and no longer
 * supports the format that was originally negotiated. Clients need
 * to connect a new stream to renegotiate a format and continue
 * playback. \since 1.0 */
#define PA_STREAM_EVENT_FORMAT_LOST

#ifndef __INCLUDED_FROM_PULSE_AUDIO
/** Port availability / jack detection status
 * \since 2.0 */
pa_port_available_t;

/** \cond fulldocs */
#define PA_PORT_AVAILABLE_UNKNOWN
#define PA_PORT_AVAILABLE_NO
#define PA_PORT_AVAILABLE_YES

/** \endcond */
#endif

PA_C_DECL_END

#endif