Home | History | Annotate | Line # | Download | only in audiocfg
audiodev.h revision 1.4.26.1
      1  1.4.26.1  christos /* $NetBSD: audiodev.h,v 1.4.26.1 2019/06/10 22:10:17 christos 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.4.26.1  christos struct audiofmt {
     39  1.4.26.1  christos 	struct audio_format fmt;
     40  1.4.26.1  christos 	TAILQ_ENTRY(audiofmt) next;
     41  1.4.26.1  christos };
     42  1.4.26.1  christos 
     43       1.1       mrg struct audiodev {
     44       1.3  jmcneill 	char pxname[16];	/* hw (parent) device */
     45       1.3  jmcneill 	char xname[16];		/* audio(4) device */
     46       1.1       mrg 	uint16_t unit;
     47       1.1       mrg 	char path[PATH_MAX+1];
     48  1.4.26.1  christos 	char ctlpath[PATH_MAX+1];
     49       1.1       mrg 
     50       1.1       mrg 	int fd;
     51       1.1       mrg 	dev_t dev;
     52       1.1       mrg 	bool defaultdev;
     53       1.1       mrg 
     54       1.1       mrg 	audio_device_t audio_device;
     55  1.4.26.1  christos 	TAILQ_HEAD(, audiofmt) formats;
     56  1.4.26.1  christos 	struct audio_info info;
     57       1.1       mrg 
     58       1.1       mrg 	TAILQ_ENTRY(audiodev) next;
     59       1.1       mrg };
     60       1.1       mrg 
     61       1.1       mrg int			audiodev_refresh(void);
     62       1.1       mrg unsigned int		audiodev_count(void);
     63       1.1       mrg struct audiodev *	audiodev_get(unsigned int);
     64       1.1       mrg int			audiodev_set_default(struct audiodev *);
     65  1.4.26.1  christos int			audiodev_set_param(struct audiodev *, int,
     66  1.4.26.1  christos 				const char *, unsigned int, unsigned int,
     67  1.4.26.1  christos 				unsigned int);
     68       1.2  jmcneill int			audiodev_test(struct audiodev *, unsigned int);
     69       1.1       mrg 
     70  1.4.26.1  christos extern const char *	encoding_names[];
     71  1.4.26.1  christos extern u_int		encoding_max;
     72  1.4.26.1  christos 
     73       1.1       mrg #endif /* !_HAVE_AUDIODEV_H */
     74