def.h

Go to the documentation of this file.
00001 #ifndef foodefhfoo
00002 #define foodefhfoo
00003 
00004 /***
00005   This file is part of PulseAudio.
00006 
00007   Copyright 2004-2006 Lennart Poettering
00008   Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
00009 
00010   PulseAudio is free software; you can redistribute it and/or modify
00011   it under the terms of the GNU Lesser General Public License as
00012   published by the Free Software Foundation; either version 2.1 of the
00013   License, or (at your option) any later version.
00014 
00015   PulseAudio is distributed in the hope that it will be useful, but
00016   WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018   Lesser General Public License for more details.
00019 
00020   You should have received a copy of the GNU Lesser General Public
00021   License along with PulseAudio; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023   USA.
00024 ***/
00025 
00026 #include <inttypes.h>
00027 #include <sys/time.h>
00028 #include <time.h>
00029 
00030 #include <pulse/cdecl.h>
00031 #include <pulse/sample.h>
00032 
00036 PA_C_DECL_BEGIN
00037 
00039 typedef enum pa_context_state {
00040     PA_CONTEXT_UNCONNECTED,    
00041     PA_CONTEXT_CONNECTING,     
00042     PA_CONTEXT_AUTHORIZING,    
00043     PA_CONTEXT_SETTING_NAME,   
00044     PA_CONTEXT_READY,          
00045     PA_CONTEXT_FAILED,         
00046     PA_CONTEXT_TERMINATED      
00047 } pa_context_state_t;
00048 
00050 static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
00051     return
00052         x == PA_CONTEXT_CONNECTING ||
00053         x == PA_CONTEXT_AUTHORIZING ||
00054         x == PA_CONTEXT_SETTING_NAME ||
00055         x == PA_CONTEXT_READY;
00056 }
00057 
00059 typedef enum pa_stream_state {
00060     PA_STREAM_UNCONNECTED,  
00061     PA_STREAM_CREATING,     
00062     PA_STREAM_READY,        
00063     PA_STREAM_FAILED,       
00064     PA_STREAM_TERMINATED    
00065 } pa_stream_state_t;
00066 
00068 static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
00069     return
00070         x == PA_STREAM_CREATING ||
00071         x == PA_STREAM_READY;
00072 }
00073 
00075 typedef enum pa_operation_state {
00076     PA_OPERATION_RUNNING,      
00077     PA_OPERATION_DONE,         
00078     PA_OPERATION_CANCELED      
00079 } pa_operation_state_t;
00080 
00082 #define PA_INVALID_INDEX ((uint32_t) -1)
00083 
00085 typedef enum pa_context_flags {
00086     PA_CONTEXT_NOAUTOSPAWN = 1
00088 } pa_context_flags_t;
00089 
00091 /* Allow clients to check with #ifdef for those flags */
00092 #define PA_CONTEXT_NOAUTOSPAWN PA_CONTEXT_NOAUTOSPAWN
00093 
00096 typedef enum pa_stream_direction {
00097     PA_STREAM_NODIRECTION,   
00098     PA_STREAM_PLAYBACK,      
00099     PA_STREAM_RECORD,        
00100     PA_STREAM_UPLOAD         
00101 } pa_stream_direction_t;
00102 
00104 typedef enum pa_stream_flags {
00105 
00106     PA_STREAM_START_CORKED = 0x0001U,
00110     PA_STREAM_INTERPOLATE_TIMING = 0x0002U,
00122     PA_STREAM_NOT_MONOTONIC = 0x0004U,
00134     PA_STREAM_AUTO_TIMING_UPDATE = 0x0008U,
00141     PA_STREAM_NO_REMAP_CHANNELS = 0x0010U,
00147     PA_STREAM_NO_REMIX_CHANNELS = 0x0020U,
00153     PA_STREAM_FIX_FORMAT = 0x0040U,
00165     PA_STREAM_FIX_RATE = 0x0080U,
00171     PA_STREAM_FIX_CHANNELS = 0x0100,
00178     PA_STREAM_DONT_MOVE = 0x0200U,
00187     PA_STREAM_VARIABLE_RATE = 0x0400U,
00193     PA_STREAM_PEAK_DETECT = 0x0800U,
00196     PA_STREAM_START_MUTED = 0x1000U,
00199     PA_STREAM_ADJUST_LATENCY = 0x2000U,
00206     PA_STREAM_EARLY_REQUESTS = 0x4000U
00223 } pa_stream_flags_t;
00224 
00227 /* English is an evil language */
00228 #define PA_STREAM_NOT_MONOTONOUS PA_STREAM_NOT_MONOTONIC
00229 
00230 /* Allow clients to check with #ifdef for those flags */
00231 #define PA_STREAM_START_CORKED PA_STREAM_START_CORKED
00232 #define PA_STREAM_INTERPOLATE_TIMING PA_STREAM_INTERPOLATE_TIMING
00233 #define PA_STREAM_NOT_MONOTONIC PA_STREAM_NOT_MONOTONIC
00234 #define PA_STREAM_AUTO_TIMING_UPDATE PA_STREAM_AUTO_TIMING_UPDATE
00235 #define PA_STREAM_NO_REMAP_CHANNELS PA_STREAM_NO_REMAP_CHANNELS
00236 #define PA_STREAM_NO_REMIX_CHANNELS PA_STREAM_NO_REMIX_CHANNELS
00237 #define PA_STREAM_FIX_FORMAT PA_STREAM_FIX_FORMAT
00238 #define PA_STREAM_FIX_RATE PA_STREAM_FIX_RATE
00239 #define PA_STREAM_FIX_CHANNELS PA_STREAM_FIX_CHANNELS
00240 #define PA_STREAM_DONT_MOVE PA_STREAM_DONT_MOVE
00241 #define PA_STREAM_VARIABLE_RATE PA_STREAM_VARIABLE_RATE
00242 #define PA_STREAM_PEAK_DETECT PA_STREAM_PEAK_DETECT
00243 #define PA_STREAM_START_MUTED PA_STREAM_START_MUTED
00244 #define PA_STREAM_ADJUST_LATENCY PA_STREAM_ADJUST_LATENCY
00245 #define PA_STREAM_EARLY_REQUESTS PA_STREAM_EARLY_REQUESTS
00246 
00250 typedef struct pa_buffer_attr {
00251     uint32_t maxlength;
00256     uint32_t tlength;
00274     uint32_t prebuf;
00285     uint32_t minreq;
00295     uint32_t fragsize;
00309 } pa_buffer_attr;
00310 
00312 enum {
00313     PA_OK = 0,                     
00314     PA_ERR_ACCESS,                 
00315     PA_ERR_COMMAND,                
00316     PA_ERR_INVALID,                
00317     PA_ERR_EXIST,                  
00318     PA_ERR_NOENTITY,               
00319     PA_ERR_CONNECTIONREFUSED,      
00320     PA_ERR_PROTOCOL,               
00321     PA_ERR_TIMEOUT,                
00322     PA_ERR_AUTHKEY,                
00323     PA_ERR_INTERNAL,               
00324     PA_ERR_CONNECTIONTERMINATED,   
00325     PA_ERR_KILLED,                 
00326     PA_ERR_INVALIDSERVER,          
00327     PA_ERR_MODINITFAILED,          
00328     PA_ERR_BADSTATE,               
00329     PA_ERR_NODATA,                 
00330     PA_ERR_VERSION,                
00331     PA_ERR_TOOLARGE,               
00332     PA_ERR_NOTSUPPORTED,           
00333     PA_ERR_UNKNOWN,                
00334     PA_ERR_NOEXTENSION,            
00335     PA_ERR_MAX                     
00336 };
00337 
00339 typedef enum pa_subscription_mask {
00340     PA_SUBSCRIPTION_MASK_NULL = 0x0000U,
00343     PA_SUBSCRIPTION_MASK_SINK = 0x0001U,
00346     PA_SUBSCRIPTION_MASK_SOURCE = 0x0002U,
00349     PA_SUBSCRIPTION_MASK_SINK_INPUT = 0x0004U,
00352     PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 0x0008U,
00355     PA_SUBSCRIPTION_MASK_MODULE = 0x0010U,
00358     PA_SUBSCRIPTION_MASK_CLIENT = 0x0020U,
00361     PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 0x0040U,
00364     PA_SUBSCRIPTION_MASK_SERVER = 0x0080U,
00367     PA_SUBSCRIPTION_MASK_AUTOLOAD = 0x0100U,
00370     PA_SUBSCRIPTION_MASK_ALL = 0x01ffU
00372 } pa_subscription_mask_t;
00373 
00375 typedef enum pa_subscription_event_type {
00376     PA_SUBSCRIPTION_EVENT_SINK = 0x0000U,
00379     PA_SUBSCRIPTION_EVENT_SOURCE = 0x0001U,
00382     PA_SUBSCRIPTION_EVENT_SINK_INPUT = 0x0002U,
00385     PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 0x0003U,
00388     PA_SUBSCRIPTION_EVENT_MODULE = 0x0004U,
00391     PA_SUBSCRIPTION_EVENT_CLIENT = 0x0005U,
00394     PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 0x0006U,
00397     PA_SUBSCRIPTION_EVENT_SERVER = 0x0007U,
00400     PA_SUBSCRIPTION_EVENT_AUTOLOAD = 0x0008U,
00403     PA_SUBSCRIPTION_EVENT_FACILITY_MASK = 0x000FU,
00406     PA_SUBSCRIPTION_EVENT_NEW = 0x0000U,
00409     PA_SUBSCRIPTION_EVENT_CHANGE = 0x0010U,
00412     PA_SUBSCRIPTION_EVENT_REMOVE = 0x0020U,
00415     PA_SUBSCRIPTION_EVENT_TYPE_MASK = 0x0030U,
00418 } pa_subscription_event_type_t;
00419 
00421 #define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK))))
00422 
00441 typedef struct pa_timing_info {
00442     struct timeval timestamp;
00445     int synchronized_clocks;
00452     pa_usec_t sink_usec;
00457     pa_usec_t source_usec;
00461     pa_usec_t transport_usec;
00465     int playing;
00472     int write_index_corrupt;
00479     int64_t write_index;
00485     int read_index_corrupt;
00490     int64_t read_index;
00496     pa_usec_t configured_sink_usec;
00499     pa_usec_t configured_source_usec;
00502     int64_t since_underrun;
00508 } pa_timing_info;
00509 
00517 typedef struct pa_spawn_api {
00518     void (*prefork)(void);
00522     void (*postfork)(void);
00526     void (*atfork)(void);
00532 } pa_spawn_api;
00533 
00535 typedef enum pa_seek_mode {
00536     PA_SEEK_RELATIVE = 0,
00539     PA_SEEK_ABSOLUTE = 1,
00542     PA_SEEK_RELATIVE_ON_READ = 2,
00545     PA_SEEK_RELATIVE_END = 3
00547 } pa_seek_mode_t;
00548 
00550 typedef enum pa_sink_flags {
00551     PA_SINK_HW_VOLUME_CTRL = 0x0001U,
00554     PA_SINK_LATENCY = 0x0002U,
00557     PA_SINK_HARDWARE = 0x0004U,
00561     PA_SINK_NETWORK = 0x0008U,
00564     PA_SINK_HW_MUTE_CTRL = 0x0010U,
00567     PA_SINK_DECIBEL_VOLUME = 0x0020U
00570 } pa_sink_flags_t;
00571 
00573 #define PA_SINK_HW_VOLUME_CTRL PA_SINK_HW_VOLUME_CTRL
00574 #define PA_SINK_LATENCY PA_SINK_LATENCY
00575 #define PA_SINK_HARDWARE PA_SINK_HARDWARE
00576 #define PA_SINK_NETWORK PA_SINK_NETWORK
00577 #define PA_SINK_HW_VOLUME_CTRL PA_SINK_HW_VOLUME_CTRL
00578 #define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME
00579 
00582 typedef enum pa_source_flags {
00583     PA_SOURCE_HW_VOLUME_CTRL = 0x0001U,
00586     PA_SOURCE_LATENCY = 0x0002U,
00589     PA_SOURCE_HARDWARE = 0x0004U,
00593     PA_SOURCE_NETWORK = 0x0008U,
00596     PA_SOURCE_HW_MUTE_CTRL = 0x0010U,
00599     PA_SOURCE_DECIBEL_VOLUME = 0x0020U
00602 } pa_source_flags_t;
00603 
00605 #define PA_SOURCE_HW_VOLUME_CTRL PA_SOURCE_HW_VOLUME_CTRL
00606 #define PA_SOURCE_LATENCY PA_SOURCE_LATENCY
00607 #define PA_SOURCE_HARDWARE PA_SOURCE_HARDWARE
00608 #define PA_SOURCE_NETWORK PA_SOURCE_NETWORK
00609 #define PA_SOURCE_HW_VOLUME_CTRL PA_SOURCE_HW_VOLUME_CTRL
00610 #define PA_SOURCE_DECIBEL_VOLUME PA_SOURCE_DECIBEL_VOLUME
00611 
00614 typedef void (*pa_free_cb_t)(void *p);
00615 
00616 PA_C_DECL_END
00617 
00618 #endif

Generated on Tue Sep 16 10:58:58 2008 for PulseAudio by  doxygen 1.5.4