Home | History | Annotate | Line # | Download | only in audiocfg
audiodev.h revision 1.3
      1  1.3  jmcneill /* $NetBSD: audiodev.h,v 1.3 2010/09/02 02:17:35 jmcneill Exp $ */
      2  1.1       mrg 
      3  1.1       mrg /*
      4  1.1       mrg  * Copyright (c) 2010 Jared D. McNeill <jmcneill (at) invisible.ca>
      5  1.1       mrg  * All rights reserved.
      6  1.1       mrg  *
      7  1.1       mrg  * Redistribution and use in source and binary forms, with or without
      8  1.1       mrg  * modification, are permitted provided that the following conditions
      9  1.1       mrg  * are met:
     10  1.1       mrg  * 1. Redistributions of source code must retain the above copyright
     11  1.1       mrg  *    notice, this list of conditions and the following disclaimer.
     12  1.1       mrg  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1       mrg  *    notice, this list of conditions and the following disclaimer in the
     14  1.1       mrg  *    documentation and/or other materials provided with the distribution.
     15  1.1       mrg  *
     16  1.1       mrg  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  1.1       mrg  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  1.1       mrg  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  1.1       mrg  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  1.1       mrg  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  1.1       mrg  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  1.1       mrg  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  1.1       mrg  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  1.1       mrg  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.1       mrg  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  1.1       mrg  * POSSIBILITY OF SUCH DAMAGE.
     27  1.1       mrg  */
     28  1.1       mrg 
     29  1.1       mrg #ifndef _HAVE_AUDIODEV_H
     30  1.1       mrg #define _HAVE_AUDIODEV_H
     31  1.1       mrg 
     32  1.1       mrg #include <sys/audioio.h>
     33  1.1       mrg #include <sys/queue.h>
     34  1.1       mrg #include <sys/syslimits.h>
     35  1.1       mrg 
     36  1.1       mrg #include <stdbool.h>
     37  1.1       mrg 
     38  1.1       mrg struct audiodev {
     39  1.3  jmcneill 	char pxname[16];	/* hw (parent) device */
     40  1.3  jmcneill 	char xname[16];		/* audio(4) device */
     41  1.1       mrg 	uint16_t unit;
     42  1.1       mrg 	char path[PATH_MAX+1];
     43  1.1       mrg 
     44  1.1       mrg 	int fd;
     45  1.1       mrg 	dev_t dev;
     46  1.1       mrg 	bool defaultdev;
     47  1.1       mrg 
     48  1.2  jmcneill 	int pchan;
     49  1.2  jmcneill 
     50  1.1       mrg 	audio_device_t audio_device;
     51  1.1       mrg 
     52  1.1       mrg 	TAILQ_ENTRY(audiodev) next;
     53  1.1       mrg };
     54  1.1       mrg 
     55  1.1       mrg int			audiodev_refresh(void);
     56  1.1       mrg unsigned int		audiodev_count(void);
     57  1.1       mrg struct audiodev *	audiodev_get(unsigned int);
     58  1.1       mrg int			audiodev_set_default(struct audiodev *);
     59  1.2  jmcneill int			audiodev_test(struct audiodev *, unsigned int);
     60  1.1       mrg 
     61  1.1       mrg #endif /* !_HAVE_AUDIODEV_H */
     62