2001-07-16 11:15:28 +00:00
|
|
|
/*
|
|
|
|
|
* Timer interface - local header file
|
2007-10-15 10:24:55 +02:00
|
|
|
* Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz>
|
2001-07-16 11:15:28 +00:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
2001-12-30 09:22:54 +00:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
2001-07-16 11:15:28 +00:00
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program 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
|
2001-12-30 09:22:54 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2001-07-16 11:15:28 +00:00
|
|
|
*
|
2001-12-30 09:22:54 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2001-07-16 11:15:28 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2001-12-30 09:22:54 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2001-07-16 11:15:28 +00:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
#include "local.h"
|
|
|
|
|
|
2005-05-24 14:14:28 +00:00
|
|
|
#ifndef DOC_HIDDEN
|
2001-07-16 11:15:28 +00:00
|
|
|
typedef struct {
|
|
|
|
|
int (*close)(snd_timer_t *timer);
|
|
|
|
|
int (*nonblock)(snd_timer_t *timer, int nonblock);
|
2003-02-06 19:15:53 +00:00
|
|
|
int (*async)(snd_timer_t *timer, int sig, pid_t pid);
|
2001-07-16 11:15:28 +00:00
|
|
|
int (*info)(snd_timer_t *timer, snd_timer_info_t *info);
|
|
|
|
|
int (*params)(snd_timer_t *timer, snd_timer_params_t *params);
|
|
|
|
|
int (*status)(snd_timer_t *timer, snd_timer_status_t *status);
|
|
|
|
|
int (*rt_start)(snd_timer_t *timer);
|
|
|
|
|
int (*rt_stop)(snd_timer_t *timer);
|
|
|
|
|
int (*rt_continue)(snd_timer_t *timer);
|
|
|
|
|
ssize_t (*read)(snd_timer_t *timer, void *buffer, size_t size);
|
|
|
|
|
} snd_timer_ops_t;
|
|
|
|
|
|
|
|
|
|
struct _snd_timer {
|
2003-03-02 19:30:52 +00:00
|
|
|
unsigned int version;
|
2006-04-25 17:26:16 +02:00
|
|
|
void *dl_handle;
|
2001-07-16 11:15:28 +00:00
|
|
|
char *name;
|
|
|
|
|
snd_timer_type_t type;
|
|
|
|
|
int mode;
|
|
|
|
|
int poll_fd;
|
2008-11-21 19:43:33 +01:00
|
|
|
const snd_timer_ops_t *ops;
|
2001-07-16 11:15:28 +00:00
|
|
|
void *private_data;
|
2005-05-11 12:18:51 +00:00
|
|
|
struct list_head async_handlers;
|
2001-07-16 11:15:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
int (*close)(snd_timer_query_t *timer);
|
|
|
|
|
int (*next_device)(snd_timer_query_t *timer, snd_timer_id_t *tid);
|
2003-03-04 20:01:06 +00:00
|
|
|
int (*info)(snd_timer_query_t *timer, snd_timer_ginfo_t *info);
|
|
|
|
|
int (*params)(snd_timer_query_t *timer, snd_timer_gparams_t *info);
|
|
|
|
|
int (*status)(snd_timer_query_t *timer, snd_timer_gstatus_t *info);
|
2001-07-16 11:15:28 +00:00
|
|
|
} snd_timer_query_ops_t;
|
|
|
|
|
|
|
|
|
|
struct _snd_timer_query {
|
2006-04-25 17:26:16 +02:00
|
|
|
void *dl_handle;
|
2001-07-16 11:15:28 +00:00
|
|
|
char *name;
|
|
|
|
|
snd_timer_type_t type;
|
|
|
|
|
int mode;
|
|
|
|
|
int poll_fd;
|
|
|
|
|
snd_timer_query_ops_t *ops;
|
|
|
|
|
void *private_data;
|
|
|
|
|
};
|
2005-05-24 14:14:28 +00:00
|
|
|
#endif /* DOC_HIDDEN */
|
|
|
|
|
|
|
|
|
|
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);
|
2001-07-16 11:15:28 +00:00
|
|
|
|
|
|
|
|
int snd_timer_query_hw_open(snd_timer_query_t **handle, const char *name, int mode);
|
2003-02-06 19:15:53 +00:00
|
|
|
|
|
|
|
|
int snd_timer_async(snd_timer_t *timer, int sig, pid_t pid);
|