00001 #ifndef foodefhfoo
00002 #define foodefhfoo
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <inttypes.h>
00026 #include <sys/time.h>
00027 #include <time.h>
00028
00029 #include <pulse/cdecl.h>
00030 #include <pulse/sample.h>
00031
00035 PA_C_DECL_BEGIN
00036
00038 typedef enum pa_context_state {
00039 PA_CONTEXT_UNCONNECTED,
00040 PA_CONTEXT_CONNECTING,
00041 PA_CONTEXT_AUTHORIZING,
00042 PA_CONTEXT_SETTING_NAME,
00043 PA_CONTEXT_READY,
00044 PA_CONTEXT_FAILED,
00045 PA_CONTEXT_TERMINATED
00046 } pa_context_state_t;
00047
00049 typedef enum pa_stream_state {
00050 PA_STREAM_UNCONNECTED,
00051 PA_STREAM_CREATING,
00052 PA_STREAM_READY,
00053 PA_STREAM_FAILED,
00054 PA_STREAM_TERMINATED
00055 } pa_stream_state_t;
00056
00058 typedef enum pa_operation_state {
00059 PA_OPERATION_RUNNING,
00060 PA_OPERATION_DONE,
00061 PA_OPERATION_CANCELED
00062 } pa_operation_state_t;
00063
00065 #define PA_INVALID_INDEX ((uint32_t) -1)
00066
00068 typedef enum pa_context_flags {
00069 PA_CONTEXT_NOAUTOSPAWN = 1
00070 } pa_context_flags_t;
00071
00073 typedef enum pa_stream_direction {
00074 PA_STREAM_NODIRECTION,
00075 PA_STREAM_PLAYBACK,
00076 PA_STREAM_RECORD,
00077 PA_STREAM_UPLOAD
00078 } pa_stream_direction_t;
00079
00081 typedef enum pa_stream_flags {
00082 PA_STREAM_START_CORKED = 1,
00083 PA_STREAM_INTERPOLATE_TIMING = 2,
00106 PA_STREAM_NOT_MONOTONOUS = 4,
00122 PA_STREAM_AUTO_TIMING_UPDATE = 8
00132 } pa_stream_flags_t;
00133
00135 typedef struct pa_buffer_attr {
00136 uint32_t maxlength;
00137 uint32_t tlength;
00138 uint32_t prebuf;
00139 uint32_t minreq;
00140 uint32_t fragsize;
00141 } pa_buffer_attr;
00142
00144 enum {
00145 PA_OK = 0,
00146 PA_ERR_ACCESS,
00147 PA_ERR_COMMAND,
00148 PA_ERR_INVALID,
00149 PA_ERR_EXIST,
00150 PA_ERR_NOENTITY,
00151 PA_ERR_CONNECTIONREFUSED,
00152 PA_ERR_PROTOCOL,
00153 PA_ERR_TIMEOUT,
00154 PA_ERR_AUTHKEY,
00155 PA_ERR_INTERNAL,
00156 PA_ERR_CONNECTIONTERMINATED,
00157 PA_ERR_KILLED,
00158 PA_ERR_INVALIDSERVER,
00159 PA_ERR_MODINITFAILED,
00160 PA_ERR_BADSTATE,
00161 PA_ERR_NODATA,
00162 PA_ERR_VERSION,
00163 PA_ERR_TOOLARGE,
00164 PA_ERR_NOTSUPPORTED,
00165 PA_ERR_MAX
00166 };
00167
00169 typedef enum pa_subscription_mask {
00170 PA_SUBSCRIPTION_MASK_NULL = 0,
00171 PA_SUBSCRIPTION_MASK_SINK = 1,
00172 PA_SUBSCRIPTION_MASK_SOURCE = 2,
00173 PA_SUBSCRIPTION_MASK_SINK_INPUT = 4,
00174 PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 8,
00175 PA_SUBSCRIPTION_MASK_MODULE = 16,
00176 PA_SUBSCRIPTION_MASK_CLIENT = 32,
00177 PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 64,
00178 PA_SUBSCRIPTION_MASK_SERVER = 128,
00179 PA_SUBSCRIPTION_MASK_AUTOLOAD = 256,
00180 PA_SUBSCRIPTION_MASK_ALL = 511
00181 } pa_subscription_mask_t;
00182
00184 typedef enum pa_subscription_event_type {
00185 PA_SUBSCRIPTION_EVENT_SINK = 0,
00186 PA_SUBSCRIPTION_EVENT_SOURCE = 1,
00187 PA_SUBSCRIPTION_EVENT_SINK_INPUT = 2,
00188 PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 3,
00189 PA_SUBSCRIPTION_EVENT_MODULE = 4,
00190 PA_SUBSCRIPTION_EVENT_CLIENT = 5,
00191 PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 6,
00192 PA_SUBSCRIPTION_EVENT_SERVER = 7,
00193 PA_SUBSCRIPTION_EVENT_AUTOLOAD = 8,
00194 PA_SUBSCRIPTION_EVENT_FACILITY_MASK = 15,
00196 PA_SUBSCRIPTION_EVENT_NEW = 0,
00197 PA_SUBSCRIPTION_EVENT_CHANGE = 16,
00198 PA_SUBSCRIPTION_EVENT_REMOVE = 32,
00199 PA_SUBSCRIPTION_EVENT_TYPE_MASK = 16+32
00200 } pa_subscription_event_type_t;
00201
00203 #define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK))))
00204
00221 typedef struct pa_timing_info {
00222 struct timeval timestamp;
00223 int synchronized_clocks;
00232 pa_usec_t sink_usec;
00233 pa_usec_t source_usec;
00234 pa_usec_t transport_usec;
00236 int playing;
00238 int write_index_corrupt;
00246 int64_t write_index;
00254 int read_index_corrupt;
00260 int64_t read_index;
00267 } pa_timing_info;
00268
00276 typedef struct pa_spawn_api {
00277 void (*prefork)(void);
00278 void (*postfork)(void);
00279 void (*atfork)(void);
00286 } pa_spawn_api;
00287
00289 typedef enum pa_seek_mode {
00290 PA_SEEK_RELATIVE = 0,
00291 PA_SEEK_ABSOLUTE = 1,
00292 PA_SEEK_RELATIVE_ON_READ = 2,
00293 PA_SEEK_RELATIVE_END = 3
00294 } pa_seek_mode_t;
00295
00297 typedef enum pa_sink_flags {
00298 PA_SINK_HW_VOLUME_CTRL = 1,
00299 PA_SINK_LATENCY = 2,
00300 PA_SINK_HARDWARE = 4
00301 } pa_sink_flags_t;
00302
00304 typedef enum pa_source_flags {
00305 PA_SOURCE_HW_VOLUME_CTRL = 1,
00306 PA_SOURCE_LATENCY = 2,
00307 PA_SOURCE_HARDWARE = 4
00308 } pa_source_flags_t;
00309
00311 typedef void (*pa_free_cb_t)(void *p);
00312
00313 PA_C_DECL_END
00314
00315 #endif