1170159Sariff/*- 2170159Sariff * Copyright (c) 2007 Ariff Abdullah <ariff@FreeBSD.org> 3170159Sariff * All rights reserved. 4170159Sariff * 5170159Sariff * Redistribution and use in source and binary forms, with or without 6170159Sariff * modification, are permitted provided that the following conditions 7170159Sariff * are met: 8170159Sariff * 1. Redistributions of source code must retain the above copyright 9170159Sariff * notice, this list of conditions and the following disclaimer. 10170159Sariff * 2. Redistributions in binary form must reproduce the above copyright 11170159Sariff * notice, this list of conditions and the following disclaimer in the 12170159Sariff * documentation and/or other materials provided with the distribution. 13170159Sariff * 14170159Sariff * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15170159Sariff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16170159Sariff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17170159Sariff * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18170159Sariff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19170159Sariff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20170159Sariff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21170159Sariff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22170159Sariff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23170159Sariff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24170159Sariff * SUCH DAMAGE. 25170159Sariff * 26170159Sariff * $FreeBSD: releng/10.2/sys/dev/sound/unit.h 170159 2007-05-31 18:35:24Z ariff $ 27170159Sariff */ 28170159Sariff 29170159Sariff#ifndef _SND_UNIT_H_ 30170159Sariff#define _SND_UNIT_H_ 31170159Sariff 32170159Sariff#define SND_UNIT_UMIN 16 33170159Sariff#define SND_UNIT_UMAX 2048 34170159Sariff 35170159Sariffint snd_max_u(void); 36170159Sariffint snd_max_d(void); 37170159Sariffint snd_max_c(void); 38170159Sariffint snd_unit2u(int); 39170159Sariffint snd_unit2d(int); 40170159Sariffint snd_unit2c(int); 41170159Sariffint snd_u2unit(int); 42170159Sariffint snd_d2unit(int); 43170159Sariffint snd_c2unit(int); 44170159Sariffint snd_mkunit(int, int, int); 45170159Sariff 46170159Sariffvoid snd_unit_init(void); 47170159Sariff 48170159Sariff#define SND_U_MASK (snd_u2unit(snd_max_u())) 49170159Sariff#define SND_D_MASK (snd_d2unit(snd_max_d())) 50170159Sariff#define SND_C_MASK (snd_c2unit(snd_max_c())) 51170159Sariff 52170159Sariff#endif /* !_SND_UNIT_H_ */ 53