Home | History | Annotate | Line # | Download | only in audiocfg
audiodev.h revision 1.1
      1  1.1  mrg /* $NetBSD: audiodev.h,v 1.1 2010/08/30 02:19:47 mrg 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.1  mrg 	char xname[16];
     40  1.1  mrg 	uint16_t unit;
     41  1.1  mrg 	char path[PATH_MAX+1];
     42  1.1  mrg 
     43  1.1  mrg 	int fd;
     44  1.1  mrg 	dev_t dev;
     45  1.1  mrg 	bool defaultdev;
     46  1.1  mrg 
     47  1.1  mrg 	audio_device_t audio_device;
     48  1.1  mrg 
     49  1.1  mrg 	TAILQ_ENTRY(audiodev) next;
     50  1.1  mrg };
     51  1.1  mrg 
     52  1.1  mrg int			audiodev_refresh(void);
     53  1.1  mrg unsigned int		audiodev_count(void);
     54  1.1  mrg struct audiodev *	audiodev_get(unsigned int);
     55  1.1  mrg int			audiodev_set_default(struct audiodev *);
     56  1.1  mrg 
     57  1.1  mrg #endif /* !_HAVE_AUDIODEV_H */
     58