|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: /* ! 25: * audio.defs ! 26: * MIG interface to audio driver kernel server. ! 27: */ ! 28: subsystem audio 700; ! 29: ! 30: #include <mach/std_types.defs> ! 31: ! 32: type audio_time_t = struct [2] of int; ! 33: type u_int = MSG_TYPE_INTEGER_32; ! 34: type audio_var_array_t = array [*:256] of int; ! 35: type audio_array_t = array [256] of int; ! 36: type audio_name_t = array [*:256] of char; ! 37: ! 38: /* ! 39: * Mig calls these to convert the port a message is ! 40: * received on into each routine's first argument. ! 41: */ ! 42: type audio_device_t = port_t ! 43: intran: audio_device_t audio_port_to_device(port_t); ! 44: type audio_stream_t = port_t ! 45: intran: audio_stream_t audio_port_to_stream(port_t); ! 46: ! 47: import <bsd/dev/audioTypes.h>; ! 48: ! 49: serverprefix _NXAudio; ! 50: userprefix _NXAudio; ! 51: ! 52: /************************** ! 53: * Generic device routines. ! 54: **************************/ ! 55: ! 56: /* ! 57: * Establish exclusive use of streams. ! 58: */ ! 59: routine GetExclusiveUser ( ! 60: devicePort : audio_device_t; ! 61: out streamOwner : port_t; ! 62: waittime timeout : int); ! 63: ! 64: routine SetExclusiveUser ( ! 65: devicePort : audio_device_t; ! 66: streamOwner : port_t; ! 67: waittime timeout : int); ! 68: ! 69: /* ! 70: * Get and set dma buffer and memory wiring options. ! 71: */ ! 72: routine GetBufferOptions ( ! 73: devicePort : audio_device_t; ! 74: out dmaSize : u_int; ! 75: out dmaCount : u_int; ! 76: waittime timeout : int); ! 77: ! 78: routine SetBufferOptions ( ! 79: devicePort : audio_device_t; ! 80: streamOwner : port_t; ! 81: dmaSize : u_int; ! 82: dmaCount : u_int; ! 83: waittime timeout : int); ! 84: ! 85: /* ! 86: * Stream control of owned streams. ! 87: */ ! 88: routine ControlStreams ( ! 89: devicePort : audio_device_t; ! 90: streamOwner : port_t; ! 91: action : int; ! 92: waittime timeout : int); ! 93: ! 94: /* ! 95: * Add a stream. ! 96: */ ! 97: routine AddStream ( ! 98: devicePort : audio_device_t; ! 99: out streamPort : port_t; ! 100: streamOwner : port_t; ! 101: streamId : int; ! 102: streamType : u_int; ! 103: waittime timeout : int); ! 104: ! 105: /* ! 106: * Get and set peak detection options. ! 107: */ ! 108: routine GetDevicePeakOptions ( ! 109: devicePort : audio_device_t; ! 110: out enabled : u_int; ! 111: out history : u_int; ! 112: waittime timeout : int); ! 113: ! 114: routine SetDevicePeakOptions ( ! 115: devicePort : audio_device_t; ! 116: streamOwner : port_t; ! 117: enabled : u_int; ! 118: history : u_int; ! 119: waittime timeout : int); ! 120: ! 121: /* ! 122: * Get last peak. ! 123: */ ! 124: routine GetDevicePeak ( ! 125: devicePort : audio_device_t; ! 126: out peakLeft : u_int; ! 127: out peakRight : u_int; ! 128: waittime timeout : int); ! 129: ! 130: /* ! 131: * Get clip count. ! 132: */ ! 133: routine GetClipCount ( ! 134: devicePort : audio_device_t; ! 135: out count : u_int; ! 136: waittime timeout : int); ! 137: ! 138: /******************** ! 139: * Soundout routines. ! 140: ********************/ ! 141: ! 142: /* ! 143: * Get and set soundout options. ! 144: */ ! 145: routine GetSndoutOptions ( ! 146: devicePort : audio_device_t; ! 147: out bits : u_int; ! 148: waittime timeout : int); ! 149: ! 150: routine SetSndoutOptions ( ! 151: devicePort : audio_device_t; ! 152: streamOwner : port_t; ! 153: bits : u_int; ! 154: waittime timeout : int); ! 155: ! 156: /* ! 157: * Get and set speaker attenuation. ! 158: */ ! 159: routine GetSpeaker ( ! 160: devicePort : audio_device_t; ! 161: out left : int; ! 162: out right : int; ! 163: waittime timeout : int); ! 164: ! 165: routine SetSpeaker ( ! 166: devicePort : audio_device_t; ! 167: streamOwner : port_t; ! 168: left : int; ! 169: right : int; ! 170: waittime timeout : int); ! 171: ! 172: /************************** ! 173: * Generic stream routines. ! 174: **************************/ ! 175: ! 176: /* ! 177: * Set stream gain. ! 178: */ ! 179: routine SetStreamGain ( ! 180: streamPort : audio_stream_t; ! 181: left : int; ! 182: right : int; ! 183: waittime timeout : int); ! 184: ! 185: /* ! 186: * Change owner of a stream. ! 187: */ ! 188: routine ChangeStreamOwner ( ! 189: streamPort : audio_stream_t; ! 190: streamOwner : port_t; ! 191: waittime timeout : int); ! 192: ! 193: /* ! 194: * Stream control. ! 195: */ ! 196: routine StreamControl ( ! 197: streamPort : audio_stream_t; ! 198: action : int; ! 199: actionTime : audio_time_t; ! 200: waittime timeout : int); ! 201: ! 202: /* ! 203: * Stream info. ! 204: */ ! 205: routine StreamInfo ( ! 206: streamPort : audio_stream_t; ! 207: out bytesProcessed : u_int; ! 208: out timeStamp : u_int; ! 209: waittime timeout : int); ! 210: ! 211: /* ! 212: * Remove a stream. ! 213: */ ! 214: routine RemoveStream ( ! 215: streamPort : audio_stream_t; ! 216: waittime timeout : int); ! 217: ! 218: /*************************** ! 219: * Playback stream routines. ! 220: ***************************/ ! 221: ! 222: /* ! 223: * Enqueue play request to stream. ! 224: */ ! 225: routine PlayStream ( ! 226: streamPort : audio_stream_t; ! 227: data : pointer_t; ! 228: /* dataCnt : int; */ /* invisible mig arg */ ! 229: tag : int; ! 230: channelCount : u_int; ! 231: sampleRate : int; ! 232: leftGain : u_int; ! 233: rightGain : u_int; ! 234: lowWater : u_int; ! 235: highWater : u_int; ! 236: streamReply : port_t; ! 237: messages : u_int; ! 238: waittime timeout : int); ! 239: ! 240: /* ! 241: * Set peak detection options. ! 242: */ ! 243: routine SetStreamPeakOptions ( ! 244: streamPort : audio_stream_t; ! 245: enabled : u_int; ! 246: history : u_int; ! 247: waittime timeout : int); ! 248: ! 249: /* ! 250: * Get last peak. ! 251: */ ! 252: routine GetStreamPeak ( ! 253: streamPort : audio_stream_t; ! 254: out peakLeft : u_int; ! 255: out peakRight : u_int; ! 256: waittime timeout : int); ! 257: ! 258: /**************************** ! 259: * Recording stream routines. ! 260: ****************************/ ! 261: ! 262: /* ! 263: * Enqueue record request to stream. ! 264: */ ! 265: routine RecordStream ( ! 266: streamPort : audio_stream_t; ! 267: count : u_int; ! 268: tag : int; ! 269: lowWater : u_int; ! 270: highWater : u_int; ! 271: streamReply : port_t; ! 272: messages : u_int; ! 273: waittime timeout : int); ! 274: ! 275: /**************************** ! 276: * New for 3.1. ! 277: ****************************/ ! 278: ! 279: /* ! 280: * Play and record with current parameters. ! 281: */ ! 282: ! 283: routine PlayStreamData ( ! 284: streamPort : audio_stream_t; ! 285: data : pointer_t; ! 286: /* dataCnt : int; */ /* invisible mig arg */ ! 287: tag : int; ! 288: streamReply : port_t; ! 289: messages : u_int; ! 290: waittime timeout : int); ! 291: ! 292: routine RecordStreamData ( ! 293: streamPort : audio_stream_t; ! 294: count : u_int; ! 295: tag : int; ! 296: streamReply : port_t; ! 297: messages : u_int; ! 298: waittime timeout : int); ! 299: ! 300: /* ! 301: * Generic parameter api. ! 302: */ ! 303: ! 304: routine GetDeviceName ( ! 305: devicePort : audio_device_t; ! 306: out name : audio_name_t; ! 307: /* out nameCnt : u_int; */ /* invisible mig arg */ ! 308: waittime timeout : int); ! 309: ! 310: routine SetDeviceParameters ( ! 311: devicePort : audio_device_t; ! 312: streamOwner : port_t; ! 313: params : audio_var_array_t; ! 314: /* paramsCnt : u_int; */ /* invisible mig arg */ ! 315: values : audio_array_t; ! 316: waittime timeout : int); ! 317: ! 318: routine GetDeviceParameters ( ! 319: devicePort : audio_device_t; ! 320: params : audio_var_array_t; ! 321: /* paramsCnt : u_int; */ /* invisible mig arg */ ! 322: out values : audio_array_t; ! 323: waittime timeout : int); ! 324: ! 325: routine GetDeviceSupportedParameters ( ! 326: devicePort : audio_device_t; ! 327: out params : audio_var_array_t; ! 328: /* out paramsCnt: u_int; */ /* invisible mig arg */ ! 329: waittime timeout : int); ! 330: ! 331: routine GetDeviceParameterValues ( ! 332: devicePort : audio_device_t; ! 333: param : int; ! 334: out values : audio_var_array_t; ! 335: /* out valuesCnt: u_int; */ /* invisible mig arg */ ! 336: waittime timeout : int); ! 337: ! 338: routine GetSamplingRates ( ! 339: devicePort : audio_device_t; ! 340: out continuous : int; ! 341: out low : int; ! 342: out high : int; ! 343: out rates : audio_var_array_t; ! 344: /* out ratesCnt : u_int; */ /* invisible mig arg */ ! 345: waittime timeout : int); ! 346: ! 347: routine GetDataEncodings ( ! 348: devicePort : audio_device_t; ! 349: out encodings : audio_var_array_t; ! 350: /* out encodingsCnt : u_int; */ /* invisible mig arg */ ! 351: waittime timeout : int); ! 352: ! 353: routine GetChannelCountLimit ( ! 354: devicePort : audio_device_t; ! 355: out count : u_int; ! 356: waittime timeout : int); ! 357: ! 358: routine SetStreamParameters ( ! 359: streamPort : audio_stream_t; ! 360: params : audio_var_array_t; ! 361: /* paramsCnt : u_int; */ /* invisible mig arg */ ! 362: values : audio_array_t; ! 363: waittime timeout : int); ! 364: ! 365: routine GetStreamParameters ( ! 366: streamPort : audio_stream_t; ! 367: params : audio_var_array_t; ! 368: /* paramsCnt : u_int; */ /* invisible mig arg */ ! 369: out values : audio_array_t; ! 370: waittime timeout : int); ! 371: ! 372: routine GetStreamSupportedParameters ( ! 373: streamPort : audio_stream_t; ! 374: out params : audio_var_array_t; ! 375: /* out paramsCnt: u_int; */ /* invisible mig arg */ ! 376: waittime timeout : int); ! 377: ! 378: routine GetStreamParameterValues ( ! 379: streamPort : audio_stream_t; ! 380: param : int; ! 381: out values : audio_var_array_t; ! 382: /* out valuesCnt: u_int; */ /* invisible mig arg */ ! 383: waittime timeout : int);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.