1*9484Sgarrett.damore@Sun.COM /* 2*9484Sgarrett.damore@Sun.COM * CDDL HEADER START 3*9484Sgarrett.damore@Sun.COM * 4*9484Sgarrett.damore@Sun.COM * The contents of this file are subject to the terms of the 5*9484Sgarrett.damore@Sun.COM * Common Development and Distribution License (the "License"). 6*9484Sgarrett.damore@Sun.COM * You may not use this file except in compliance with the License. 7*9484Sgarrett.damore@Sun.COM * 8*9484Sgarrett.damore@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*9484Sgarrett.damore@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*9484Sgarrett.damore@Sun.COM * See the License for the specific language governing permissions 11*9484Sgarrett.damore@Sun.COM * and limitations under the License. 12*9484Sgarrett.damore@Sun.COM * 13*9484Sgarrett.damore@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*9484Sgarrett.damore@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*9484Sgarrett.damore@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*9484Sgarrett.damore@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*9484Sgarrett.damore@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*9484Sgarrett.damore@Sun.COM * 19*9484Sgarrett.damore@Sun.COM * CDDL HEADER END 20*9484Sgarrett.damore@Sun.COM */ 21*9484Sgarrett.damore@Sun.COM /* 22*9484Sgarrett.damore@Sun.COM * Copyright (C) 4Front Technologies 1996-2008. 23*9484Sgarrett.damore@Sun.COM * 24*9484Sgarrett.damore@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 25*9484Sgarrett.damore@Sun.COM * Use is subject to license terms. 26*9484Sgarrett.damore@Sun.COM */ 27*9484Sgarrett.damore@Sun.COM 28*9484Sgarrett.damore@Sun.COM #ifndef _SYS_AUDIO_AUDIO_COMMON_H 29*9484Sgarrett.damore@Sun.COM #define _SYS_AUDIO_AUDIO_COMMON_H 30*9484Sgarrett.damore@Sun.COM 31*9484Sgarrett.damore@Sun.COM #include <sys/mkdev.h> 32*9484Sgarrett.damore@Sun.COM #include <sys/types.h> 33*9484Sgarrett.damore@Sun.COM 34*9484Sgarrett.damore@Sun.COM #ifdef __cplusplus 35*9484Sgarrett.damore@Sun.COM extern "C" { 36*9484Sgarrett.damore@Sun.COM #endif 37*9484Sgarrett.damore@Sun.COM 38*9484Sgarrett.damore@Sun.COM #ifdef _KERNEL 39*9484Sgarrett.damore@Sun.COM 40*9484Sgarrett.damore@Sun.COM /* Shared data structures */ 41*9484Sgarrett.damore@Sun.COM typedef struct audio_parms audio_parms_t; 42*9484Sgarrett.damore@Sun.COM typedef struct audio_buffer audio_buffer_t; 43*9484Sgarrett.damore@Sun.COM typedef struct audio_stream audio_stream_t; 44*9484Sgarrett.damore@Sun.COM typedef struct audio_engine audio_engine_t; 45*9484Sgarrett.damore@Sun.COM typedef struct audio_client audio_client_t; 46*9484Sgarrett.damore@Sun.COM typedef struct audio_dev audio_dev_t; 47*9484Sgarrett.damore@Sun.COM typedef struct audio_mixer_ops audio_mixer_ops_t; 48*9484Sgarrett.damore@Sun.COM typedef struct audio_engine_ops audio_engine_ops_t; 49*9484Sgarrett.damore@Sun.COM typedef struct audio_ctrl audio_ctrl_t; 50*9484Sgarrett.damore@Sun.COM typedef struct audio_ctrl_desc audio_ctrl_desc_t; 51*9484Sgarrett.damore@Sun.COM 52*9484Sgarrett.damore@Sun.COM struct audio_ctrl_desc { 53*9484Sgarrett.damore@Sun.COM const char *acd_name; /* Controls Mnemonic */ 54*9484Sgarrett.damore@Sun.COM uint32_t acd_type; /* Entry type */ 55*9484Sgarrett.damore@Sun.COM uint64_t acd_flags; /* Characteristics */ 56*9484Sgarrett.damore@Sun.COM /* 57*9484Sgarrett.damore@Sun.COM * Minimum and Maximum values for this control. The value 58*9484Sgarrett.damore@Sun.COM * must be between these values inclusive. For 59*9484Sgarrett.damore@Sun.COM * AUDIO_CTRL_TYPE_ENUM, the maxvalue is a bitmask of 60*9484Sgarrett.damore@Sun.COM * supported controls. 61*9484Sgarrett.damore@Sun.COM */ 62*9484Sgarrett.damore@Sun.COM uint64_t acd_maxvalue; /* max value control */ 63*9484Sgarrett.damore@Sun.COM uint64_t acd_minvalue; /* min value control */ 64*9484Sgarrett.damore@Sun.COM /* 65*9484Sgarrett.damore@Sun.COM * Array of pointers to names for each enum position. This 66*9484Sgarrett.damore@Sun.COM * should be null for all but AUDIO_CTRL_TYPE_ENUM. 67*9484Sgarrett.damore@Sun.COM */ 68*9484Sgarrett.damore@Sun.COM const char *acd_enum[64]; 69*9484Sgarrett.damore@Sun.COM }; 70*9484Sgarrett.damore@Sun.COM 71*9484Sgarrett.damore@Sun.COM /* 72*9484Sgarrett.damore@Sun.COM * Audio data formats. Note that these are represented int a bit 73*9484Sgarrett.damore@Sun.COM * field, to allow for multiple values to be represented in the same 74*9484Sgarrett.damore@Sun.COM * integer (in certain portions of the API.) 75*9484Sgarrett.damore@Sun.COM */ 76*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_NONE 0x00000000U 77*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_ULAW 0x00000001U 78*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_ALAW 0x00000002U 79*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S8 0x00000004U 80*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U8 0x00000008U 81*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S16_LE 0x00000010U 82*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S16_BE 0x00000020U 83*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U16_LE 0x00000040U 84*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U16_BE 0x00000080U 85*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_LE 0x00000100U 86*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_BE 0x00000200U 87*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S32_LE 0x00000400U 88*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S32_BE 0x00000800U 89*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_PACKED 0x00001000U 90*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_AC3 0x00010000U 91*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_OPAQUE_MASK 0xffff0000U 92*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_CONVERTIBLE 0x0000ffffU 93*9484Sgarrett.damore@Sun.COM /* 94*9484Sgarrett.damore@Sun.COM * We only support signed 16, 24, and 32 bit format conversions in the 95*9484Sgarrett.damore@Sun.COM * engines, for simplicity. (We haven't run into any engines that 96*9484Sgarrett.damore@Sun.COM * require other formats.) 97*9484Sgarrett.damore@Sun.COM */ 98*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_PCM 0x00000f30 99*9484Sgarrett.damore@Sun.COM 100*9484Sgarrett.damore@Sun.COM /* 101*9484Sgarrett.damore@Sun.COM * Some big endian/little endian handling macros (native endian and opposite 102*9484Sgarrett.damore@Sun.COM * endian formats). The usage of these macros is described in the OSS 103*9484Sgarrett.damore@Sun.COM * Programmer's Manual. 104*9484Sgarrett.damore@Sun.COM */ 105*9484Sgarrett.damore@Sun.COM 106*9484Sgarrett.damore@Sun.COM #if defined(_BIG_ENDIAN) 107*9484Sgarrett.damore@Sun.COM 108*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S16_NE AUDIO_FORMAT_S16_BE 109*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U16_NE AUDIO_FORMAT_U16_BE 110*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S32_NE AUDIO_FORMAT_S32_BE 111*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_NE AUDIO_FORMAT_S24_BE 112*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S16_OE AUDIO_FORMAT_S16_LE 113*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U16_OE AUDIO_FORMAT_U16_LE 114*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S32_OE AUDIO_FORMAT_S32_LE 115*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_OE AUDIO_FORMAT_S24_LE 116*9484Sgarrett.damore@Sun.COM 117*9484Sgarrett.damore@Sun.COM #elif defined(_LITTLE_ENDIAN) 118*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S16_NE AUDIO_FORMAT_S16_LE 119*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U16_NE AUDIO_FORMAT_U16_LE 120*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S32_NE AUDIO_FORMAT_S32_LE 121*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_NE AUDIO_FORMAT_S24_LE 122*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S16_OE AUDIO_FORMAT_S16_BE 123*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_U16_OE AUDIO_FORMAT_U16_BE 124*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S32_OE AUDIO_FORMAT_S32_BE 125*9484Sgarrett.damore@Sun.COM #define AUDIO_FORMAT_S24_OE AUDIO_FORMAT_S24_BE 126*9484Sgarrett.damore@Sun.COM 127*9484Sgarrett.damore@Sun.COM #else 128*9484Sgarrett.damore@Sun.COM #error "Machine endianness undefined" 129*9484Sgarrett.damore@Sun.COM #endif 130*9484Sgarrett.damore@Sun.COM 131*9484Sgarrett.damore@Sun.COM /* 132*9484Sgarrett.damore@Sun.COM * These are parameterized around the maximum minor number available 133*9484Sgarrett.damore@Sun.COM * for use in the filesystem. Unfortunately, we have to use 32-bit limits, 134*9484Sgarrett.damore@Sun.COM * because we could have 32-bit userland apps (we usually will, in fact). 135*9484Sgarrett.damore@Sun.COM */ 136*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_CLONE_NBITS (NBITSMINOR32 - 1) 137*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_CLONE_MASK (1U << (AUDIO_MN_CLONE_NBITS - 1)) 138*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_TYPE_NBITS (4) 139*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_TYPE_SHIFT (0) 140*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_TYPE_MASK ((1U << AUDIO_MN_TYPE_NBITS) - 1) 141*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_INST_NBITS ((NBITSMINOR32 - 1) - AUDIO_MN_TYPE_NBITS) 142*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_INST_MASK ((1U << AUDIO_MN_INST_NBITS) - 1) 143*9484Sgarrett.damore@Sun.COM #define AUDIO_MN_INST_SHIFT (AUDIO_MN_TYPE_NBITS) 144*9484Sgarrett.damore@Sun.COM #define AUDIO_MKMN(inst, typ) \ 145*9484Sgarrett.damore@Sun.COM (((inst) << AUDIO_MN_INST_SHIFT) | ((typ) << AUDIO_MN_TYPE_SHIFT)) 146*9484Sgarrett.damore@Sun.COM 147*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_MIXER (0) 148*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_DSP (1) 149*9484Sgarrett.damore@Sun.COM /* 2 is reserved for now */ 150*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_DEVAUDIO (3) 151*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_DEVAUDIOCTL (4) 152*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_SNDSTAT (AUDIO_MN_TYPE_MASK) 153*9484Sgarrett.damore@Sun.COM 154*9484Sgarrett.damore@Sun.COM /* reserved minors for driver specific use */ 155*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_DRV1 (AUDIO_MINOR_SNDSTAT - 1) 156*9484Sgarrett.damore@Sun.COM #define AUDIO_MINOR_DRV2 (AUDIO_MINOR_SNDSTAT - 2) 157*9484Sgarrett.damore@Sun.COM 158*9484Sgarrett.damore@Sun.COM 159*9484Sgarrett.damore@Sun.COM /* Various controls */ 160*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_VOLUME "volume" 161*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_LINEOUT "line-out" 162*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_FRONT "front" 163*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_REAR "rear" 164*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_HEADPHONE "headphones" 165*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_CENTER "center" 166*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_LFE "lfe" 167*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_SURROUND "surround" 168*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_SPEAKER "speaker" 169*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_AUX1OUT "aux1-out" 170*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_AUX2OUT "aux2-out" 171*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_BASS "bass" 172*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_TREBLE "treble" 173*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_3DDEPTH "3d-depth" 174*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_3DCENT "3d-center" 175*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_3DENHANCE "3d-enhance" 176*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_PHONE "phone" 177*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_MIC "mic" 178*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_LINEIN "line-in" 179*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_CD "cd" 180*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_VIDEO "video" 181*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_AUX1IN "aux1-in" 182*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_PCMIN "pcm" 183*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_RECGAIN "record-gain" 184*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_AUX2IN "aux2-in" 185*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_MICBOOST "micboost" 186*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_LOOPBACK "loopback" 187*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_LOUDNESS "loudness" 188*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_OUTPUTS "outputs" 189*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_INPUTS "inputs" 190*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_RECSRC "record-source" 191*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_MONSRC "monitor-source" 192*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_DIAG "diag" 193*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_BEEP "beep" 194*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_MONGAIN "monitor-gain" 195*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_STEREOSIM "stereo-simulate" /* AC'97 feature */ 196*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_MICGAIN "mic-gain" /* mono mic gain */ 197*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_SPKSRC "speaker-source" /* AC'97 feature */ 198*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_MICSRC "mic-source" /* AC'97 feature */ 199*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK1 "jack1" /* jack repurposing */ 200*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK2 "jack2" 201*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK3 "jack3" 202*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK4 "jack4" 203*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK5 "jack5" 204*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK6 "jack6" 205*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_JACK7 "jack7" 206*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_DOWNMIX "downmix" 207*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_ID_SPREAD "spread" 208*9484Sgarrett.damore@Sun.COM 209*9484Sgarrett.damore@Sun.COM /* 210*9484Sgarrett.damore@Sun.COM * Names for ports. 211*9484Sgarrett.damore@Sun.COM */ 212*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_MIC "mic" 213*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_CD "cd" 214*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_VIDEO "video" 215*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_AUX1OUT "aux1-out" 216*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_AUX2OUT "aux2-out" 217*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_LINEOUT "line-out" 218*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_STEREOMIX "stereo-mix" 219*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_MONOMIX "mono-mix" 220*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_PHONE "phone" 221*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_REAR "rear" 222*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_CENTER "center" 223*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_SURROUND "surround" 224*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_LFE "lfe" 225*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_SPEAKER "speaker" 226*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_LINEIN "line-in" 227*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_AUX1IN "aux1-in" 228*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_AUX2IN "aux2-in" 229*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_HEADPHONES "headphones" 230*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_SPDIFIN "spdif-in" 231*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_SPDIFOUT "spdif-out" 232*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_CENLFE "center/lfe" /* combined jack use */ 233*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_MIC1 "mic1" 234*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_MIC2 "mic2" 235*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_DIGOUT "digital-out" 236*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_DIGIN "digital-in" 237*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_HDMI "hdmi" 238*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_MODEM "modem" 239*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_HANDSET "handset" 240*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_OTHER "other" 241*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_STEREO "stereo" /* e.g. mic array */ 242*9484Sgarrett.damore@Sun.COM #define AUDIO_PORT_NONE "none" 243*9484Sgarrett.damore@Sun.COM 244*9484Sgarrett.damore@Sun.COM /* 245*9484Sgarrett.damore@Sun.COM * A few common values that sometimes we see. 246*9484Sgarrett.damore@Sun.COM */ 247*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_ON "on" 248*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_OFF "off" 249*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_VERYLOW "very-low" 250*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_LOW "low" 251*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_MEDIUM "medium" 252*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_HIGH "high" 253*9484Sgarrett.damore@Sun.COM #define AUDIO_VALUE_VERYHIGH "very-high" 254*9484Sgarrett.damore@Sun.COM 255*9484Sgarrett.damore@Sun.COM /* 256*9484Sgarrett.damore@Sun.COM * Posible return values for walk callback function 257*9484Sgarrett.damore@Sun.COM */ 258*9484Sgarrett.damore@Sun.COM #define AUDIO_WALK_CONTINUE 1 /* continue walk */ 259*9484Sgarrett.damore@Sun.COM #define AUDIO_WALK_STOP 2 /* stop the walk */ 260*9484Sgarrett.damore@Sun.COM #define AUDIO_WALK_RESTART 3 /* restart the walk from beginning */ 261*9484Sgarrett.damore@Sun.COM 262*9484Sgarrett.damore@Sun.COM /* 263*9484Sgarrett.damore@Sun.COM * Control types 264*9484Sgarrett.damore@Sun.COM */ 265*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_TYPE_BOOLEAN 1 /* ON/OFF control */ 266*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_TYPE_ENUM 2 /* Enumerated list */ 267*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_TYPE_STEREO 3 /* stereo level control */ 268*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_TYPE_MONO 4 /* mono level control */ 269*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_TYPE_METER 5 /* VU meter */ 270*9484Sgarrett.damore@Sun.COM 271*9484Sgarrett.damore@Sun.COM /* 272*9484Sgarrett.damore@Sun.COM * Control characteristics flags 273*9484Sgarrett.damore@Sun.COM */ 274*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_READABLE 0x00000001 /* Control readable */ 275*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_WRITEABLE 0x00000002 /* Control writable */ 276*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_RW 0x00000003 /* Read/writeable */ 277*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_VUPEAK 0x00000004 /* peak meter */ 278*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_CENTIBEL 0x00000008 /* Centibel (0.1 dB) */ 279*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_DECIBEL 0x00000010 /* Step size of 1 dB */ 280*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_POLL 0x00000020 /* May change itself */ 281*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_MAINVOL 0x00000100 /* Main volume ctrl */ 282*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_PCMVOL 0x00000200 /* PCM output volume */ 283*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_RECVOL 0x00000400 /* PCM record volume */ 284*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_MONVOL 0x00000800 /* Monitor volume */ 285*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_PLAY 0x00001000 /* Playback control */ 286*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_REC 0x00002000 /* Record control */ 287*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_3D 0x00004000 /* 3D effect control */ 288*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_TONE 0x00008000 /* Tone control */ 289*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_MONITOR 0x00010000 /* Monitor control */ 290*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_DIGITAL 0x00020000 /* Digital control */ 291*9484Sgarrett.damore@Sun.COM 292*9484Sgarrett.damore@Sun.COM /* 293*9484Sgarrett.damore@Sun.COM * AUDIO_CTRL_TYPE_ENUM might allow more than a single value to be 294*9484Sgarrett.damore@Sun.COM * selected. (Value is a bitmask.) 295*9484Sgarrett.damore@Sun.COM */ 296*9484Sgarrett.damore@Sun.COM #define AUDIO_CTRL_FLAG_MULTI 0x00000040 297*9484Sgarrett.damore@Sun.COM 298*9484Sgarrett.damore@Sun.COM #endif /* _KERNEL */ 299*9484Sgarrett.damore@Sun.COM 300*9484Sgarrett.damore@Sun.COM #ifdef __cplusplus 301*9484Sgarrett.damore@Sun.COM } 302*9484Sgarrett.damore@Sun.COM #endif 303*9484Sgarrett.damore@Sun.COM 304*9484Sgarrett.damore@Sun.COM #endif /* _SYS_AUDIO_AUDIO_COMMON_H */ 305