Home | History | Annotate | Download | only in timer
      1 /*
      2  *  Timer interface - local header file
      3  *  Copyright (c) 2001 by Jaroslav Kysela <perex (at) perex.cz>
      4  *
      5  *
      6  *   This library is free software; you can redistribute it and/or modify
      7  *   it under the terms of the GNU Lesser General Public License as
      8  *   published by the Free Software Foundation; either version 2.1 of
      9  *   the License, or (at your option) any later version.
     10  *
     11  *   This program is distributed in the hope that it will be useful,
     12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14  *   GNU Lesser General Public License for more details.
     15  *
     16  *   You should have received a copy of the GNU Lesser General Public
     17  *   License along with this library; if not, write to the Free Software
     18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
     19  *
     20  */
     21 
     22 #include <stdio.h>
     23 #include <stdlib.h>
     24 #include <limits.h>
     25 #include "local.h"
     26 
     27 #ifndef DOC_HIDDEN
     28 typedef struct {
     29 	int (*close)(snd_timer_t *timer);
     30 	int (*nonblock)(snd_timer_t *timer, int nonblock);
     31 	int (*async)(snd_timer_t *timer, int sig, pid_t pid);
     32 	int (*info)(snd_timer_t *timer, snd_timer_info_t *info);
     33 	int (*params)(snd_timer_t *timer, snd_timer_params_t *params);
     34 	int (*status)(snd_timer_t *timer, snd_timer_status_t *status);
     35 	int (*rt_start)(snd_timer_t *timer);
     36 	int (*rt_stop)(snd_timer_t *timer);
     37 	int (*rt_continue)(snd_timer_t *timer);
     38 	ssize_t (*read)(snd_timer_t *timer, void *buffer, size_t size);
     39 } snd_timer_ops_t;
     40 
     41 struct _snd_timer {
     42 	unsigned int version;
     43 	void *dl_handle;
     44 	char *name;
     45 	snd_timer_type_t type;
     46 	int mode;
     47 	int poll_fd;
     48 	const snd_timer_ops_t *ops;
     49 	void *private_data;
     50 	struct list_head async_handlers;
     51 };
     52 
     53 typedef struct {
     54 	int (*close)(snd_timer_query_t *timer);
     55 	int (*next_device)(snd_timer_query_t *timer, snd_timer_id_t *tid);
     56 	int (*info)(snd_timer_query_t *timer, snd_timer_ginfo_t *info);
     57 	int (*params)(snd_timer_query_t *timer, snd_timer_gparams_t *info);
     58 	int (*status)(snd_timer_query_t *timer, snd_timer_gstatus_t *info);
     59 } snd_timer_query_ops_t;
     60 
     61 struct _snd_timer_query {
     62 	void *dl_handle;
     63 	char *name;
     64 	snd_timer_type_t type;
     65 	int mode;
     66 	int poll_fd;
     67 	snd_timer_query_ops_t *ops;
     68 	void *private_data;
     69 };
     70 #endif /* DOC_HIDDEN */
     71 
     72 int snd_timer_hw_open(snd_timer_t **handle, const char *name, int dev_class, int dev_sclass, int card, int device, int subdevice, int mode);
     73 
     74 int snd_timer_query_hw_open(snd_timer_query_t **handle, const char *name, int mode);
     75 
     76 int snd_timer_async(snd_timer_t *timer, int sig, pid_t pid);
     77