Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

timer.h

Go to the documentation of this file.
00001 
00028 #ifndef __ALSA_TIMER_H
00029 #define __ALSA_TIMER_H
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00042 #define SND_TIMER_DLSYM_VERSION         _dlsym_timer_001
00043 
00044 #define SND_TIMER_QUERY_DLSYM_VERSION   _dlsym_timer_query_001
00045 
00047 typedef struct _snd_timer_id snd_timer_id_t;
00049 typedef struct _snd_timer_info snd_timer_info_t;
00051 typedef struct _snd_timer_params snd_timer_params_t;
00053 typedef struct _snd_timer_status snd_timer_status_t;
00055 typedef struct _snd_timer_read {
00056         unsigned int resolution;        
00057         unsigned int ticks;             
00058 } snd_timer_read_t;
00059 
00061 typedef enum _snd_timer_class {
00062         SND_TIMER_CLASS_NONE = -1,      
00063         SND_TIMER_CLASS_SLAVE = 0,      
00064         SND_TIMER_CLASS_GLOBAL,         
00065         SND_TIMER_CLASS_CARD,           
00066         SND_TIMER_CLASS_PCM,            
00067         SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM      
00068 } snd_timer_class_t;
00069 
00071 typedef enum _snd_timer_slave_class {
00072         SND_TIMER_SCLASS_NONE = 0,              
00073         SND_TIMER_SCLASS_APPLICATION,           
00074         SND_TIMER_SCLASS_SEQUENCER,             
00075         SND_TIMER_SCLASS_OSS_SEQUENCER,         
00076         SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER  
00077 } snd_timer_slave_class_t;
00078 
00080 #define SND_TIMER_GLOBAL_SYSTEM 0
00081 
00082 #define SND_TIMER_GLOBAL_RTC    1
00083 
00085 #define SND_TIMER_OPEN_NONBLOCK         0x0001
00086 
00088 typedef enum _snd_timer_type {
00090         SND_TIMER_TYPE_HW = 0,
00092         SND_TIMER_TYPE_SHM,
00094         SND_TIMER_TYPE_INET
00095 } snd_timer_type_t;
00096 
00098 typedef struct _snd_timer_query snd_timer_query_t;
00100 typedef struct _snd_timer snd_timer_t;
00101 
00102 
00103 int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode);
00104 int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf);
00105 int snd_timer_query_close(snd_timer_query_t *handle);
00106 int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid);
00107 
00108 int snd_timer_open(snd_timer_t **handle, const char *name, int mode);
00109 int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf);
00110 int snd_timer_close(snd_timer_t *handle);
00111 int snd_timer_poll_descriptors_count(snd_timer_t *handle);
00112 int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space);
00113 int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
00114 int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer);
00115 int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params);
00116 int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status);
00117 int snd_timer_start(snd_timer_t *handle);
00118 int snd_timer_stop(snd_timer_t *handle);
00119 int snd_timer_continue(snd_timer_t *handle);
00120 ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size);
00121 
00122 size_t snd_timer_id_sizeof(void);
00124 #define snd_timer_id_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_id_t *) alloca(snd_timer_id_sizeof()); memset(*ptr, 0, snd_timer_id_sizeof()); } while (0)
00125 int snd_timer_id_malloc(snd_timer_id_t **ptr);
00126 void snd_timer_id_free(snd_timer_id_t *obj);
00127 void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src);
00128 
00129 void snd_timer_id_set_class(snd_timer_id_t *id, int dev_class);
00130 int snd_timer_id_get_class(snd_timer_id_t *id);
00131 void snd_timer_id_set_sclass(snd_timer_id_t *id, int dev_sclass);
00132 int snd_timer_id_get_sclass(snd_timer_id_t *id);
00133 void snd_timer_id_set_card(snd_timer_id_t *id, int card);
00134 int snd_timer_id_get_card(snd_timer_id_t *id);
00135 void snd_timer_id_set_device(snd_timer_id_t *id, int device);
00136 int snd_timer_id_get_device(snd_timer_id_t *id);
00137 void snd_timer_id_set_subdevice(snd_timer_id_t *id, int subdevice);
00138 int snd_timer_id_get_subdevice(snd_timer_id_t *id);
00139 
00140 size_t snd_timer_info_sizeof(void);
00142 #define snd_timer_info_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_info_t *) alloca(snd_timer_info_sizeof()); memset(*ptr, 0, snd_timer_info_sizeof()); } while (0)
00143 int snd_timer_info_malloc(snd_timer_info_t **ptr);
00144 void snd_timer_info_free(snd_timer_info_t *obj);
00145 void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src);
00146 
00147 int snd_timer_info_is_slave(snd_timer_info_t * info);
00148 int snd_timer_info_get_card(snd_timer_info_t * info);
00149 const char *snd_timer_info_get_id(snd_timer_info_t * info);
00150 const char *snd_timer_info_get_name(snd_timer_info_t * info);
00151 long snd_timer_info_get_ticks(snd_timer_info_t * info);
00152 long snd_timer_info_get_resolution(snd_timer_info_t * info);
00153 
00154 size_t snd_timer_params_sizeof(void);
00156 #define snd_timer_params_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_params_t *) alloca(snd_timer_params_sizeof()); memset(*ptr, 0, snd_timer_params_sizeof()); } while (0)
00157 int snd_timer_params_malloc(snd_timer_params_t **ptr);
00158 void snd_timer_params_free(snd_timer_params_t *obj);
00159 void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src);
00160 
00161 void snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start);
00162 void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks);
00163 long snd_timer_params_get_ticks(snd_timer_params_t * params);
00164 void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size);
00165 long snd_timer_params_get_queue_size(snd_timer_params_t * params);
00166 
00167 size_t snd_timer_status_sizeof(void);
00169 #define snd_timer_status_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_status_t *) alloca(snd_timer_status_sizeof()); memset(*ptr, 0, snd_timer_status_sizeof()); } while (0)
00170 int snd_timer_status_malloc(snd_timer_status_t **ptr);
00171 void snd_timer_status_free(snd_timer_status_t *obj);
00172 void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src);
00173 
00174 struct timeval snd_timer_status_get_timestamp(snd_timer_status_t * status);
00175 long snd_timer_status_get_resolution(snd_timer_status_t * status);
00176 long snd_timer_status_get_lost(snd_timer_status_t * status);
00177 long snd_timer_status_get_overrun(snd_timer_status_t * status);
00178 long snd_timer_status_get_queue(snd_timer_status_t * status);
00179 
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185 
00186 #endif 

Generated on Sun Sep 29 12:29:28 2002 for ALSA project - the C library reference by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002