| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
#ifndef _SYS_SOUNDCARD_H_ |
| 42 |
#define _SYS_SOUNDCARD_H_ |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
#define SOUND_VERSION 301 |
| 68 |
#define VOXWARE |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
#define SNDCARD_ADLIB 1 |
| 77 |
#define SNDCARD_SB 2 |
| 78 |
#define SNDCARD_PAS 3 |
| 79 |
#define SNDCARD_GUS 4 |
| 80 |
#define SNDCARD_MPU401 5 |
| 81 |
#define SNDCARD_SB16 6 |
| 82 |
#define SNDCARD_SB16MIDI 7 |
| 83 |
#define SNDCARD_UART6850 8 |
| 84 |
#define SNDCARD_GUS16 9 |
| 85 |
#define SNDCARD_MSS 10 |
| 86 |
#define SNDCARD_PSS 11 |
| 87 |
#define SNDCARD_SSCAPE 12 |
| 88 |
#define SNDCARD_PSS_MPU 13 |
| 89 |
#define SNDCARD_PSS_MSS 14 |
| 90 |
#define SNDCARD_SSCAPE_MSS 15 |
| 91 |
#define SNDCARD_TRXPRO 16 |
| 92 |
#define SNDCARD_TRXPRO_SB 17 |
| 93 |
#define SNDCARD_TRXPRO_MPU 18 |
| 94 |
#define SNDCARD_MAD16 19 |
| 95 |
#define SNDCARD_MAD16_MPU 20 |
| 96 |
#define SNDCARD_CS4232 21 |
| 97 |
#define SNDCARD_CS4232_MPU 22 |
| 98 |
#define SNDCARD_MAUI 23 |
| 99 |
#define SNDCARD_PSEUDO_MSS 24 |
| 100 |
#define SNDCARD_AWE32 25 |
| 101 |
#define SNDCARD_NSS 26 |
| 102 |
#define SNDCARD_UART16550 27 |
| 103 |
#define SNDCARD_OPL 28 |
| 104 |
|
| 105 |
#include <sys/types.h> |
| 106 |
#include <machine/endian.h> |
| 107 |
#ifndef _IOWR |
| 108 |
#include <sys/ioccom.h> |
| 109 |
#endif |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
#define AIONWRITE _IOR('A', 10, int) |
| 136 |
struct snd_size { |
| 137 |
int play_size; |
| 138 |
int rec_size; |
| 139 |
}; |
| 140 |
#define AIOGSIZE _IOR('A', 11, struct snd_size) |
| 141 |
#define AIOSSIZE _IOWR('A', 11, struct snd_size) |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
#define AFMT_QUERY 0x00000000 |
| 160 |
#define AFMT_MU_LAW 0x00000001 |
| 161 |
#define AFMT_A_LAW 0x00000002 |
| 162 |
#define AFMT_IMA_ADPCM 0x00000004 |
| 163 |
|
| 164 |
|
| 165 |
#define AFMT_U8 0x00000008 |
| 166 |
#define AFMT_S16_LE 0x00000010 |
| 167 |
#define AFMT_S16_BE 0x00000020 |
| 168 |
#define AFMT_S8 0x00000040 |
| 169 |
#define AFMT_U16_LE 0x00000080 |
| 170 |
#define AFMT_U16_BE 0x00000100 |
| 171 |
#define AFMT_MPEG 0x00000200 |
| 172 |
#define AFMT_AC3 0x00000400 |
| 173 |
|
| 174 |
#if _BYTE_ORDER == _LITTLE_ENDIAN |
| 175 |
#define AFMT_S16_NE AFMT_S16_LE |
| 176 |
#else |
| 177 |
#define AFMT_S16_NE AFMT_S16_BE |
| 178 |
#endif |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
#define AFMT_S32_LE 0x00001000 |
| 186 |
#define AFMT_S32_BE 0x00002000 |
| 187 |
#define AFMT_U32_LE 0x00004000 |
| 188 |
#define AFMT_U32_BE 0x00008000 |
| 189 |
#define AFMT_S24_LE 0x00010000 |
| 190 |
#define AFMT_S24_BE 0x00020000 |
| 191 |
#define AFMT_U24_LE 0x00040000 |
| 192 |
#define AFMT_U24_BE 0x00080000 |
| 193 |
|
| 194 |
#define AFMT_STEREO 0x10000000 |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
#define AFMT_WEIRD 0x20000000 |
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
#define AFMT_FULLDUPLEX 0x80000000 |
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
typedef struct _snd_chan_param { |
| 220 |
u_long play_rate; |
| 221 |
u_long rec_rate; |
| 222 |
u_long play_format; |
| 223 |
u_long rec_format; |
| 224 |
} snd_chan_param; |
| 225 |
#define AIOGFMT _IOR('f', 12, snd_chan_param) |
| 226 |
#define AIOSFMT _IOWR('f', 12, snd_chan_param) |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
typedef struct _snd_mix_param { |
| 233 |
u_char subdev; |
| 234 |
u_char line; |
| 235 |
u_char left,right; |
| 236 |
} snd_mix_param ; |
| 237 |
|
| 238 |
|
| 239 |
#define AIOGMIX _IOWR('A', 13, snd_mix_param) |
| 240 |
#define AIOSMIX _IOWR('A', 14, snd_mix_param) |
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
#define AIOSYNC_PLAY 0x1 |
| 246 |
#define AIOSYNC_CAPTURE 0x2 |
| 247 |
|
| 248 |
#define AIOSTOP _IOWR ('A', 15, int) |
| 249 |
|
| 250 |
|
| 251 |
#define AIOSYNC_SIGNAL 0x100 |
| 252 |
#define AIOSYNC_SELECT 0x200 |
| 253 |
|
| 254 |
|
| 255 |
#define AIOSYNC_READY 0x400 |
| 256 |
#define AIOSYNC_FREE 0x800 |
| 257 |
|
| 258 |
typedef struct _snd_sync_parm { |
| 259 |
long chan ; |
| 260 |
long pos; |
| 261 |
} snd_sync_parm; |
| 262 |
#define AIOSYNC _IOWR ('A', 15, snd_sync_parm) |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
typedef struct _snd_capabilities { |
| 274 |
u_long rate_min, rate_max; |
| 275 |
u_long formats; |
| 276 |
u_long bufsize; |
| 277 |
u_long mixers; |
| 278 |
u_long inputs; |
| 279 |
u_short left, right; |
| 280 |
} snd_capabilities; |
| 281 |
#define AIOGCAP _IOWR('A', 15, snd_capabilities) |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
#define SNDCTL_SEQ_RESET _IO ('Q', 0) |
| 292 |
#define SNDCTL_SEQ_SYNC _IO ('Q', 1) |
| 293 |
#define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info) |
| 294 |
#define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) |
| 295 |
#define SNDCTL_SEQ_GETOUTCOUNT _IOR ('Q', 4, int) |
| 296 |
#define SNDCTL_SEQ_GETINCOUNT _IOR ('Q', 5, int) |
| 297 |
#define SNDCTL_SEQ_PERCMODE _IOW ('Q', 6, int) |
| 298 |
#define SNDCTL_FM_LOAD_INSTR _IOW ('Q', 7, struct sbi_instrument) |
| 299 |
#define SNDCTL_SEQ_TESTMIDI _IOW ('Q', 8, int) |
| 300 |
#define SNDCTL_SEQ_RESETSAMPLES _IOW ('Q', 9, int) |
| 301 |
#define SNDCTL_SEQ_NRSYNTHS _IOR ('Q',10, int) |
| 302 |
#define SNDCTL_SEQ_NRMIDIS _IOR ('Q',11, int) |
| 303 |
#define SNDCTL_MIDI_INFO _IOWR('Q',12, struct midi_info) |
| 304 |
#define SNDCTL_SEQ_THRESHOLD _IOW ('Q',13, int) |
| 305 |
#define SNDCTL_SEQ_TRESHOLD SNDCTL_SEQ_THRESHOLD |
| 306 |
#define SNDCTL_SYNTH_MEMAVL _IOWR('Q',14, int) |
| 307 |
#define SNDCTL_FM_4OP_ENABLE _IOW ('Q',15, int) |
| 308 |
#define SNDCTL_PMGR_ACCESS _IOWR('Q',16, struct patmgr_info) |
| 309 |
#define SNDCTL_SEQ_PANIC _IO ('Q',17) |
| 310 |
#define SNDCTL_SEQ_OUTOFBAND _IOW ('Q',18, struct seq_event_rec) |
| 311 |
#define SNDCTL_SEQ_GETTIME _IOR ('Q',19, int) |
| 312 |
|
| 313 |
struct seq_event_rec { |
| 314 |
u_char arr[8]; |
| 315 |
}; |
| 316 |
|
| 317 |
#define SNDCTL_TMR_TIMEBASE _IOWR('T', 1, int) |
| 318 |
#define SNDCTL_TMR_START _IO ('T', 2) |
| 319 |
#define SNDCTL_TMR_STOP _IO ('T', 3) |
| 320 |
#define SNDCTL_TMR_CONTINUE _IO ('T', 4) |
| 321 |
#define SNDCTL_TMR_TEMPO _IOWR('T', 5, int) |
| 322 |
#define SNDCTL_TMR_SOURCE _IOWR('T', 6, int) |
| 323 |
# define TMR_INTERNAL 0x00000001 |
| 324 |
# define TMR_EXTERNAL 0x00000002 |
| 325 |
# define TMR_MODE_MIDI 0x00000010 |
| 326 |
# define TMR_MODE_FSK 0x00000020 |
| 327 |
# define TMR_MODE_CLS 0x00000040 |
| 328 |
# define TMR_MODE_SMPTE 0x00000080 |
| 329 |
#define SNDCTL_TMR_METRONOME _IOW ('T', 7, int) |
| 330 |
#define SNDCTL_TMR_SELECT _IOW ('T', 8, int) |
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
#if defined(_AIX) || defined(AIX) |
| 337 |
# define _PATCHKEY(id) (0xfd00|id) |
| 338 |
#else |
| 339 |
# define _PATCHKEY(id) ((id<<8)|0xfd) |
| 340 |
#endif |
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
struct patch_info { |
| 350 |
|
| 351 |
short key; |
| 352 |
#define GUS_PATCH _PATCHKEY(0x04) |
| 353 |
#define OBSOLETE_GUS_PATCH _PATCHKEY(0x02) |
| 354 |
|
| 355 |
short device_no; |
| 356 |
short instr_no; |
| 357 |
|
| 358 |
u_long mode; |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
#define WAVE_16_BITS 0x01 |
| 364 |
#define WAVE_UNSIGNED 0x02 |
| 365 |
#define WAVE_LOOPING 0x04 |
| 366 |
#define WAVE_BIDIR_LOOP 0x08 |
| 367 |
#define WAVE_LOOP_BACK 0x10 |
| 368 |
#define WAVE_SUSTAIN_ON 0x20 |
| 369 |
#define WAVE_ENVELOPES 0x40 |
| 370 |
|
| 371 |
|
| 372 |
#define WAVE_VIBRATO 0x00010000 |
| 373 |
#define WAVE_TREMOLO 0x00020000 |
| 374 |
#define WAVE_SCALE 0x00040000 |
| 375 |
|
| 376 |
|
| 377 |
long len; |
| 378 |
long loop_start, loop_end; |
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
u_int base_freq; |
| 397 |
u_long base_note; |
| 398 |
u_long high_note; |
| 399 |
u_long low_note; |
| 400 |
int panning; |
| 401 |
int detuning; |
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
u_char env_rate[ 6 ]; |
| 407 |
u_char env_offset[ 6 ]; |
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
u_char tremolo_sweep; |
| 416 |
u_char tremolo_rate; |
| 417 |
u_char tremolo_depth; |
| 418 |
|
| 419 |
u_char vibrato_sweep; |
| 420 |
u_char vibrato_rate; |
| 421 |
u_char vibrato_depth; |
| 422 |
|
| 423 |
int scale_frequency; |
| 424 |
u_int scale_factor; |
| 425 |
|
| 426 |
int volume; |
| 427 |
int spare[4]; |
| 428 |
char data[1]; |
| 429 |
}; |
| 430 |
|
| 431 |
struct sysex_info { |
| 432 |
short key; |
| 433 |
#define SYSEX_PATCH _PATCHKEY(0x05) |
| 434 |
#define MAUI_PATCH _PATCHKEY(0x06) |
| 435 |
short device_no; |
| 436 |
long len; |
| 437 |
u_char data[1]; |
| 438 |
}; |
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
#define PS_NO_PATCHES 0 |
| 447 |
#define PS_MGR_NOT_OK 1 |
| 448 |
#define PS_MGR_OK 2 |
| 449 |
#define PS_MANAGED 3 |
| 450 |
|
| 451 |
#define SNDCTL_PMGR_IFACE _IOWR('P', 1, struct patmgr_info) |
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
struct patmgr_info { |
| 467 |
u_long key; |
| 468 |
|
| 469 |
#define PM_K_EVENT 1 |
| 470 |
#define PM_K_COMMAND 2 |
| 471 |
#define PM_K_RESPONSE 3 |
| 472 |
#define PM_ERROR 4 |
| 473 |
int device; |
| 474 |
int command; |
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
#define PM_GET_DEVTYPE 1 |
| 480 |
#define PMTYPE_FM2 1 |
| 481 |
#define PMTYPE_FM4 2 |
| 482 |
#define PMTYPE_WAVE 3 |
| 483 |
#define PM_GET_NRPGM 2 |
| 484 |
#define PM_GET_PGMMAP 3 |
| 485 |
#define PM_GET_PGM_PATCHES 4 |
| 486 |
#define PM_GET_PATCH 5 |
| 487 |
#define PM_SET_PATCH 6 |
| 488 |
#define PM_READ_PATCH 7 |
| 489 |
#define PM_WRITE_PATCH 8 |
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
#define _PM_LOAD_PATCH 0x100 |
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
long parm1; |
| 502 |
long parm2; |
| 503 |
long parm3; |
| 504 |
|
| 505 |
union { |
| 506 |
u_char data8[4000]; |
| 507 |
u_short data16[2000]; |
| 508 |
u_long data32[1000]; |
| 509 |
struct patch_info patch; |
| 510 |
} data; |
| 511 |
}; |
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
|
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
#define PM_E_OPENED 1 |
| 520 |
#define PM_E_CLOSED 2 |
| 521 |
#define PM_E_PATCH_RESET 3 |
| 522 |
#define PM_E_PATCH_LOADED 4 |
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
#define SEQ_NOTEOFF 0 |
| 545 |
#define SEQ_FMNOTEOFF SEQ_NOTEOFF |
| 546 |
#define SEQ_NOTEON 1 |
| 547 |
#define SEQ_FMNOTEON SEQ_NOTEON |
| 548 |
#define SEQ_WAIT TMR_WAIT_ABS |
| 549 |
#define SEQ_PGMCHANGE 3 |
| 550 |
#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE |
| 551 |
#define SEQ_SYNCTIMER TMR_START |
| 552 |
#define SEQ_MIDIPUTC 5 |
| 553 |
#define SEQ_DRUMON 6 |
| 554 |
#define SEQ_DRUMOFF 7 |
| 555 |
#define SEQ_ECHO TMR_ECHO |
| 556 |
#define SEQ_AFTERTOUCH 9 |
| 557 |
#define SEQ_CONTROLLER 10 |
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
|
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
#define CTL_BANK_SELECT 0x00 |
| 571 |
#define CTL_MODWHEEL 0x01 |
| 572 |
#define CTL_BREATH 0x02 |
| 573 |
|
| 574 |
#define CTL_FOOT 0x04 |
| 575 |
#define CTL_PORTAMENTO_TIME 0x05 |
| 576 |
#define CTL_DATA_ENTRY 0x06 |
| 577 |
#define CTL_MAIN_VOLUME 0x07 |
| 578 |
#define CTL_BALANCE 0x08 |
| 579 |
|
| 580 |
#define CTL_PAN 0x0a |
| 581 |
#define CTL_EXPRESSION 0x0b |
| 582 |
|
| 583 |
#define CTL_GENERAL_PURPOSE1 0x10 |
| 584 |
#define CTL_GENERAL_PURPOSE2 0x11 |
| 585 |
#define CTL_GENERAL_PURPOSE3 0x12 |
| 586 |
#define CTL_GENERAL_PURPOSE4 0x13 |
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
#define CTL_DAMPER_PEDAL 0x40 |
| 600 |
#define CTL_SUSTAIN CTL_DAMPER_PEDAL |
| 601 |
#define CTL_HOLD CTL_DAMPER_PEDAL |
| 602 |
#define CTL_PORTAMENTO 0x41 |
| 603 |
#define CTL_SOSTENUTO 0x42 |
| 604 |
#define CTL_SOFT_PEDAL 0x43 |
| 605 |
|
| 606 |
#define CTL_HOLD2 0x45 |
| 607 |
|
| 608 |
|
| 609 |
#define CTL_GENERAL_PURPOSE5 0x50 |
| 610 |
#define CTL_GENERAL_PURPOSE6 0x51 |
| 611 |
#define CTL_GENERAL_PURPOSE7 0x52 |
| 612 |
#define CTL_GENERAL_PURPOSE8 0x53 |
| 613 |
|
| 614 |
#define CTL_EXT_EFF_DEPTH 0x5b |
| 615 |
#define CTL_TREMOLO_DEPTH 0x5c |
| 616 |
#define CTL_CHORUS_DEPTH 0x5d |
| 617 |
#define CTL_DETUNE_DEPTH 0x5e |
| 618 |
#define CTL_CELESTE_DEPTH CTL_DETUNE_DEPTH |
| 619 |
#define CTL_PHASER_DEPTH 0x5f |
| 620 |
#define CTL_DATA_INCREMENT 0x60 |
| 621 |
#define CTL_DATA_DECREMENT 0x61 |
| 622 |
#define CTL_NONREG_PARM_NUM_LSB 0x62 |
| 623 |
#define CTL_NONREG_PARM_NUM_MSB 0x63 |
| 624 |
#define CTL_REGIST_PARM_NUM_LSB 0x64 |
| 625 |
#define CTL_REGIST_PARM_NUM_MSB 0x65 |
| 626 |
|
| 627 |
|
| 628 |
|
| 629 |
|
| 630 |
#define CTRL_PITCH_BENDER 255 |
| 631 |
#define CTRL_PITCH_BENDER_RANGE 254 |
| 632 |
#define CTRL_EXPRESSION 253 |
| 633 |
#define CTRL_MAIN_VOLUME 252 |
| 634 |
|
| 635 |
#define SEQ_BALANCE 11 |
| 636 |
#define SEQ_VOLMODE 12 |
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
#define VOL_METHOD_ADAGIO 1 |
| 643 |
#define VOL_METHOD_LINEAR 2 |
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
#define SEQ_FULLSIZE 0xfd |
| 655 |
|
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
#define SEQ_PRIVATE 0xfe |
| 677 |
#define SEQ_EXTENDED 0xff |
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
|
| 683 |
typedef u_char sbi_instr_data[32]; |
| 684 |
|
| 685 |
struct sbi_instrument { |
| 686 |
u_short key; |
| 687 |
#define FM_PATCH _PATCHKEY(0x01) |
| 688 |
#define OPL3_PATCH _PATCHKEY(0x03) |
| 689 |
short device; |
| 690 |
int channel; |
| 691 |
sbi_instr_data operators; |
| 692 |
|
| 693 |
}; |
| 694 |
|
| 695 |
struct synth_info { |
| 696 |
char name[30]; |
| 697 |
int device; |
| 698 |
int synth_type; |
| 699 |
#define SYNTH_TYPE_FM 0 |
| 700 |
#define SYNTH_TYPE_SAMPLE 1 |
| 701 |
#define SYNTH_TYPE_MIDI 2 |
| 702 |
|
| 703 |
int synth_subtype; |
| 704 |
#define FM_TYPE_ADLIB 0x00 |
| 705 |
#define FM_TYPE_OPL3 0x01 |
| 706 |
#define MIDI_TYPE_MPU401 0x401 |
| 707 |
|
| 708 |
#define SAMPLE_TYPE_BASIC 0x10 |
| 709 |
#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC |
| 710 |
#define SAMPLE_TYPE_AWE32 0x20 |
| 711 |
|
| 712 |
int perc_mode; |
| 713 |
int nr_voices; |
| 714 |
int nr_drums; |
| 715 |
int instr_bank_size; |
| 716 |
u_long capabilities; |
| 717 |
#define SYNTH_CAP_PERCMODE 0x00000001 |
| 718 |
#define SYNTH_CAP_OPL3 0x00000002 |
| 719 |
#define SYNTH_CAP_INPUT 0x00000004 |
| 720 |
int dummies[19]; |
| 721 |
}; |
| 722 |
|
| 723 |
struct sound_timer_info { |
| 724 |
char name[32]; |
| 725 |
int caps; |
| 726 |
}; |
| 727 |
|
| 728 |
struct midi_info { |
| 729 |
char name[30]; |
| 730 |
int device; |
| 731 |
u_long capabilities; |
| 732 |
int dev_type; |
| 733 |
int dummies[18]; |
| 734 |
}; |
| 735 |
|
| 736 |
|
| 737 |
|
| 738 |
|
| 739 |
typedef struct { |
| 740 |
u_char cmd; |
| 741 |
char nr_args, nr_returns; |
| 742 |
u_char data[30]; |
| 743 |
} mpu_command_rec; |
| 744 |
|
| 745 |
#define SNDCTL_MIDI_PRETIME _IOWR('m', 0, int) |
| 746 |
#define SNDCTL_MIDI_MPUMODE _IOWR('m', 1, int) |
| 747 |
#define SNDCTL_MIDI_MPUCMD _IOWR('m', 2, mpu_command_rec) |
| 748 |
#define MIOSPASSTHRU _IOWR('m', 3, int) |
| 749 |
#define MIOGPASSTHRU _IOWR('m', 4, int) |
| 750 |
|
| 751 |
|
| 752 |
|
| 753 |
|
| 754 |
|
| 755 |
#define SNDCTL_DSP_RESET _IO ('P', 0) |
| 756 |
#define SNDCTL_DSP_SYNC _IO ('P', 1) |
| 757 |
#define SNDCTL_DSP_SPEED _IOWR('P', 2, int) |
| 758 |
#define SNDCTL_DSP_STEREO _IOWR('P', 3, int) |
| 759 |
#define SNDCTL_DSP_GETBLKSIZE _IOR('P', 4, int) |
| 760 |
#define SNDCTL_DSP_SETBLKSIZE _IOW('P', 4, int) |
| 761 |
#define SNDCTL_DSP_SETFMT _IOWR('P',5, int) |
| 762 |
|
| 763 |
|
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
#define SOUND_PCM_WRITE_CHANNELS _IOWR('P', 6, int) |
| 768 |
#define SNDCTL_DSP_CHANNELS SOUND_PCM_WRITE_CHANNELS |
| 769 |
#define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) |
| 770 |
#define SNDCTL_DSP_POST _IO ('P', 8) |
| 771 |
|
| 772 |
|
| 773 |
|
| 774 |
|
| 775 |
|
| 776 |
#define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) |
| 777 |
#define SNDCTL_DSP_SETFRAGMENT _IOWR('P',10, int) |
| 778 |
|
| 779 |
|
| 780 |
#define SNDCTL_DSP_GETFMTS _IOR ('P',11, int) |
| 781 |
|
| 782 |
|
| 783 |
|
| 784 |
typedef struct audio_buf_info { |
| 785 |
int fragments; |
| 786 |
int fragstotal; |
| 787 |
int fragsize; |
| 788 |
|
| 789 |
int bytes; |
| 790 |
|
| 791 |
} audio_buf_info; |
| 792 |
|
| 793 |
#define SNDCTL_DSP_GETOSPACE _IOR ('P',12, audio_buf_info) |
| 794 |
#define SNDCTL_DSP_GETISPACE _IOR ('P',13, audio_buf_info) |
| 795 |
|
| 796 |
|
| 797 |
|
| 798 |
|
| 799 |
|
| 800 |
|
| 801 |
#define SNDCTL_DSP_NONBLOCK _IO ('P',14) |
| 802 |
|
| 803 |
#define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) |
| 804 |
#define DSP_CAP_REVISION 0x000000ff |
| 805 |
#define DSP_CAP_DUPLEX 0x00000100 |
| 806 |
#define DSP_CAP_REALTIME 0x00000200 |
| 807 |
#define DSP_CAP_BATCH 0x00000400 |
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
#define DSP_CAP_COPROC 0x00000800 |
| 813 |
|
| 814 |
#define DSP_CAP_TRIGGER 0x00001000 |
| 815 |
#define DSP_CAP_MMAP 0x00002000 |
| 816 |
|
| 817 |
|
| 818 |
|
| 819 |
|
| 820 |
#define SNDCTL_DSP_GETTRIGGER _IOR ('P',16, int) |
| 821 |
#define SNDCTL_DSP_SETTRIGGER _IOW ('P',16, int) |
| 822 |
#define PCM_ENABLE_INPUT 0x00000001 |
| 823 |
#define PCM_ENABLE_OUTPUT 0x00000002 |
| 824 |
|
| 825 |
typedef struct count_info { |
| 826 |
int bytes; |
| 827 |
int blocks; |
| 828 |
int ptr; |
| 829 |
} count_info; |
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
|
| 834 |
#define SNDCTL_DSP_GETIPTR _IOR ('P',17, count_info) |
| 835 |
#define SNDCTL_DSP_GETOPTR _IOR ('P',18, count_info) |
| 836 |
|
| 837 |
typedef struct buffmem_desc { |
| 838 |
caddr_t buffer; |
| 839 |
int size; |
| 840 |
} buffmem_desc; |
| 841 |
|
| 842 |
#define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, buffmem_desc) |
| 843 |
#define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, buffmem_desc) |
| 844 |
#define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) |
| 845 |
#define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) |
| 846 |
#define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) |
| 847 |
|
| 848 |
|
| 849 |
|
| 850 |
|
| 851 |
|
| 852 |
#define SOUND_PCM_READ_RATE _IOR ('P', 2, int) |
| 853 |
#define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) |
| 854 |
#define SOUND_PCM_READ_BITS _IOR ('P', 5, int) |
| 855 |
#define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) |
| 856 |
|
| 857 |
|
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
typedef struct copr_buffer { |
| 863 |
int command; |
| 864 |
int flags; |
| 865 |
#define CPF_NONE 0x0000 |
| 866 |
#define CPF_FIRST 0x0001 |
| 867 |
#define CPF_LAST 0x0002 |
| 868 |
int len; |
| 869 |
int offs; |
| 870 |
|
| 871 |
u_char data[4000]; |
| 872 |
} copr_buffer; |
| 873 |
|
| 874 |
typedef struct copr_debug_buf { |
| 875 |
int command; |
| 876 |
int parm1; |
| 877 |
int parm2; |
| 878 |
int flags; |
| 879 |
int len; |
| 880 |
} copr_debug_buf; |
| 881 |
|
| 882 |
typedef struct copr_msg { |
| 883 |
int len; |
| 884 |
u_char data[4000]; |
| 885 |
} copr_msg; |
| 886 |
|
| 887 |
#define SNDCTL_COPR_RESET _IO ('C', 0) |
| 888 |
#define SNDCTL_COPR_LOAD _IOWR('C', 1, copr_buffer) |
| 889 |
#define SNDCTL_COPR_RDATA _IOWR('C', 2, copr_debug_buf) |
| 890 |
#define SNDCTL_COPR_RCODE _IOWR('C', 3, copr_debug_buf) |
| 891 |
#define SNDCTL_COPR_WDATA _IOW ('C', 4, copr_debug_buf) |
| 892 |
#define SNDCTL_COPR_WCODE _IOW ('C', 5, copr_debug_buf) |
| 893 |
#define SNDCTL_COPR_RUN _IOWR('C', 6, copr_debug_buf) |
| 894 |
#define SNDCTL_COPR_HALT _IOWR('C', 7, copr_debug_buf) |
| 895 |
#define SNDCTL_COPR_SENDMSG _IOW ('C', 8, copr_msg) |
| 896 |
#define SNDCTL_COPR_RCVMSG _IOR ('C', 9, copr_msg) |
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 |
|
| 902 |
|
| 903 |
|
| 904 |
|
| 905 |
|
| 906 |
|
| 907 |
|
| 908 |
|
| 909 |
|
| 910 |
|
| 911 |
#define SOUND_MIXER_NRDEVICES 25 |
| 912 |
#define SOUND_MIXER_VOLUME 0 |
| 913 |
#define SOUND_MIXER_BASS 1 |
| 914 |
#define SOUND_MIXER_TREBLE 2 |
| 915 |
#define SOUND_MIXER_SYNTH 3 |
| 916 |
#define SOUND_MIXER_PCM 4 |
| 917 |
#define SOUND_MIXER_SPEAKER 5 |
| 918 |
|
| 919 |
#define SOUND_MIXER_LINE 6 |
| 920 |
#define SOUND_MIXER_MIC 7 |
| 921 |
|
| 922 |
#define SOUND_MIXER_CD 8 |
| 923 |
|
| 924 |
#define SOUND_MIXER_IMIX 9 |
| 925 |
|
| 926 |
|
| 927 |
#define SOUND_MIXER_ALTPCM 10 |
| 928 |
|
| 929 |
#define SOUND_MIXER_RECLEV 11 |
| 930 |
#define SOUND_MIXER_IGAIN 12 |
| 931 |
#define SOUND_MIXER_OGAIN 13 |
| 932 |
|
| 933 |
|
| 934 |
|
| 935 |
|
| 936 |
|
| 937 |
|
| 938 |
#define SOUND_MIXER_LINE1 14 |
| 939 |
#define SOUND_MIXER_LINE2 15 |
| 940 |
#define SOUND_MIXER_LINE3 16 |
| 941 |
#define SOUND_MIXER_DIGITAL1 17 |
| 942 |
#define SOUND_MIXER_DIGITAL2 18 |
| 943 |
#define SOUND_MIXER_DIGITAL3 19 |
| 944 |
#define SOUND_MIXER_PHONEIN 20 |
| 945 |
#define SOUND_MIXER_PHONEOUT 21 |
| 946 |
#define SOUND_MIXER_VIDEO 22 |
| 947 |
#define SOUND_MIXER_RADIO 23 |
| 948 |
#define SOUND_MIXER_MONITOR 24 |
| 949 |
|
| 950 |
|
| 951 |
|
| 952 |
|
| 953 |
|
| 954 |
|
| 955 |
#define SOUND_ONOFF_MIN 28 |
| 956 |
#define SOUND_ONOFF_MAX 30 |
| 957 |
#define SOUND_MIXER_MUTE 28 |
| 958 |
#define SOUND_MIXER_ENHANCE 29 |
| 959 |
#define SOUND_MIXER_LOUD 30 |
| 960 |
|
| 961 |
|
| 962 |
#define SOUND_MIXER_NONE 31 |
| 963 |
|
| 964 |
#define SOUND_DEVICE_LABELS { \ |
| 965 |
"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ |
| 966 |
"Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ |
| 967 |
"Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ |
| 968 |
"PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} |
| 969 |
|
| 970 |
#define SOUND_DEVICE_NAMES { \ |
| 971 |
"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ |
| 972 |
"mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ |
| 973 |
"line1", "line2", "line3", "dig1", "dig2", "dig3", \ |
| 974 |
"phin", "phout", "video", "radio", "monitor"} |
| 975 |
|
| 976 |
|
| 977 |
|
| 978 |
#define SOUND_MIXER_RECSRC 0xff |
| 979 |
#define SOUND_MIXER_DEVMASK 0xfe |
| 980 |
#define SOUND_MIXER_RECMASK 0xfd |
| 981 |
#define SOUND_MIXER_CAPS 0xfc |
| 982 |
#define SOUND_CAP_EXCL_INPUT 0x00000001 |
| 983 |
#define SOUND_MIXER_STEREODEVS 0xfb |
| 984 |
|
| 985 |
|
| 986 |
|
| 987 |
#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) |
| 988 |
#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) |
| 989 |
#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) |
| 990 |
#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) |
| 991 |
#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) |
| 992 |
#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) |
| 993 |
#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) |
| 994 |
#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) |
| 995 |
#define SOUND_MASK_CD (1 << SOUND_MIXER_CD) |
| 996 |
#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) |
| 997 |
#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) |
| 998 |
#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) |
| 999 |
#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) |
| 1000 |
#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) |
| 1001 |
#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) |
| 1002 |
#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) |
| 1003 |
#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) |
| 1004 |
#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) |
| 1005 |
#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) |
| 1006 |
#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) |
| 1007 |
#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) |
| 1008 |
#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) |
| 1009 |
#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) |
| 1010 |
#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) |
| 1011 |
#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) |
| 1012 |
|
| 1013 |
|
| 1014 |
#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE) |
| 1015 |
#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE) |
| 1016 |
#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD) |
| 1017 |
|
| 1018 |
#define MIXER_READ(dev) _IOR('M', dev, int) |
| 1019 |
#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) |
| 1020 |
#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) |
| 1021 |
#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) |
| 1022 |
#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) |
| 1023 |
#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) |
| 1024 |
#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) |
| 1025 |
#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) |
| 1026 |
#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) |
| 1027 |
#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) |
| 1028 |
#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) |
| 1029 |
#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) |
| 1030 |
#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) |
| 1031 |
#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) |
| 1032 |
#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) |
| 1033 |
#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) |
| 1034 |
#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) |
| 1035 |
#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) |
| 1036 |
#define SOUND_MIXER_READ_DIGITAL1 MIXER_READ(SOUND_MIXER_DIGITAL1) |
| 1037 |
#define SOUND_MIXER_READ_DIGITAL2 MIXER_READ(SOUND_MIXER_DIGITAL2) |
| 1038 |
#define SOUND_MIXER_READ_DIGITAL3 MIXER_READ(SOUND_MIXER_DIGITAL3) |
| 1039 |
#define SOUND_MIXER_READ_PHONEIN MIXER_READ(SOUND_MIXER_PHONEIN) |
| 1040 |
#define SOUND_MIXER_READ_PHONEOUT MIXER_READ(SOUND_MIXER_PHONEOUT) |
| 1041 |
#define SOUND_MIXER_READ_RADIO MIXER_READ(SOUND_MIXER_RADIO) |
| 1042 |
#define SOUND_MIXER_READ_VIDEO MIXER_READ(SOUND_MIXER_VIDEO) |
| 1043 |
#define SOUND_MIXER_READ_MONITOR MIXER_READ(SOUND_MIXER_MONITOR) |
| 1044 |
|
| 1045 |
|
| 1046 |
#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE) |
| 1047 |
#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE) |
| 1048 |
#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD) |
| 1049 |
|
| 1050 |
#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) |
| 1051 |
#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) |
| 1052 |
#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) |
| 1053 |
#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) |
| 1054 |
#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) |
| 1055 |
|
| 1056 |
#define MIXER_WRITE(dev) _IOWR('M', dev, int) |
| 1057 |
#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) |
| 1058 |
#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) |
| 1059 |
#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) |
| 1060 |
#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) |
| 1061 |
#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) |
| 1062 |
#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) |
| 1063 |
#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) |
| 1064 |
#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) |
| 1065 |
#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) |
| 1066 |
#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) |
| 1067 |
#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) |
| 1068 |
#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) |
| 1069 |
#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) |
| 1070 |
#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) |
| 1071 |
#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) |
| 1072 |
#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) |
| 1073 |
#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) |
| 1074 |
#define SOUND_MIXER_WRITE_DIGITAL1 MIXER_WRITE(SOUND_MIXER_DIGITAL1) |
| 1075 |
#define SOUND_MIXER_WRITE_DIGITAL2 MIXER_WRITE(SOUND_MIXER_DIGITAL2) |
| 1076 |
#define SOUND_MIXER_WRITE_DIGITAL3 MIXER_WRITE(SOUND_MIXER_DIGITAL3) |
| 1077 |
#define SOUND_MIXER_WRITE_PHONEIN MIXER_WRITE(SOUND_MIXER_PHONEIN) |
| 1078 |
#define SOUND_MIXER_WRITE_PHONEOUT MIXER_WRITE(SOUND_MIXER_PHONEOUT) |
| 1079 |
#define SOUND_MIXER_WRITE_RADIO MIXER_WRITE(SOUND_MIXER_RADIO) |
| 1080 |
#define SOUND_MIXER_WRITE_VIDEO MIXER_WRITE(SOUND_MIXER_VIDEO) |
| 1081 |
#define SOUND_MIXER_WRITE_MONITOR MIXER_WRITE(SOUND_MIXER_MONITOR) |
| 1082 |
|
| 1083 |
#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE) |
| 1084 |
#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE) |
| 1085 |
#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD) |
| 1086 |
|
| 1087 |
#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) |
| 1088 |
|
| 1089 |
typedef struct mixer_info { |
| 1090 |
char id[16]; |
| 1091 |
char name[32]; |
| 1092 |
int modify_counter; |
| 1093 |
int fillers[10]; |
| 1094 |
} mixer_info; |
| 1095 |
|
| 1096 |
#define SOUND_MIXER_INFO _IOR('M', 101, mixer_info) |
| 1097 |
|
| 1098 |
#define LEFT_CHN 0 |
| 1099 |
#define RIGHT_CHN 1 |
| 1100 |
|
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
|
| 1106 |
|
| 1107 |
|
| 1108 |
|
| 1109 |
|
| 1110 |
|
| 1111 |
|
| 1112 |
|
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
|
| 1117 |
|
| 1118 |
|
| 1119 |
#define EV_SEQ_LOCAL 0x80 |
| 1120 |
#define EV_TIMING 0x81 |
| 1121 |
#define EV_CHN_COMMON 0x92 |
| 1122 |
#define EV_CHN_VOICE 0x93 |
| 1123 |
#define EV_SYSEX 0x94 |
| 1124 |
|
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
|
| 1131 |
|
| 1132 |
|
| 1133 |
#define MIDI_NOTEOFF 0x80 |
| 1134 |
#define MIDI_NOTEON 0x90 |
| 1135 |
#define MIDI_KEY_PRESSURE 0xA0 |
| 1136 |
|
| 1137 |
|
| 1138 |
|
| 1139 |
|
| 1140 |
|
| 1141 |
#define MIDI_CTL_CHANGE 0xB0 |
| 1142 |
#define MIDI_PGM_CHANGE 0xC0 |
| 1143 |
#define MIDI_CHN_PRESSURE 0xD0 |
| 1144 |
#define MIDI_PITCH_BEND 0xE0 |
| 1145 |
|
| 1146 |
#define MIDI_SYSTEM_PREFIX 0xF0 |
| 1147 |
|
| 1148 |
|
| 1149 |
|
| 1150 |
|
| 1151 |
#define TMR_WAIT_REL 1 |
| 1152 |
#define TMR_WAIT_ABS 2 |
| 1153 |
#define TMR_STOP 3 |
| 1154 |
#define TMR_START 4 |
| 1155 |
#define TMR_CONTINUE 5 |
| 1156 |
#define TMR_TEMPO 6 |
| 1157 |
#define TMR_ECHO 8 |
| 1158 |
#define TMR_CLOCK 9 |
| 1159 |
#define TMR_SPP 10 |
| 1160 |
#define TMR_TIMESIG 11 |
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
#define LOCL_STARTAUDIO 1 |
| 1166 |
|
| 1167 |
#if (!defined(_KERNEL) && !defined(INKERNEL)) || defined(USE_SEQ_MACROS) |
| 1168 |
|
| 1169 |
|
| 1170 |
|
| 1171 |
|
| 1172 |
|
| 1173 |
|
| 1174 |
|
| 1175 |
#ifndef USE_SIMPLE_MACROS |
| 1176 |
void seqbuf_dump(void); |
| 1177 |
|
| 1178 |
|
| 1179 |
|
| 1180 |
|
| 1181 |
|
| 1182 |
|
| 1183 |
|
| 1184 |
|
| 1185 |
|
| 1186 |
|
| 1187 |
|
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 |
#define SEQ_DEFINEBUF(len) \ |
| 1198 |
u_char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0 |
| 1199 |
#define SEQ_USE_EXTBUF() \ |
| 1200 |
extern u_char _seqbuf[]; \ |
| 1201 |
extern int _seqbuflen;extern int _seqbufptr |
| 1202 |
#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF() |
| 1203 |
#define SEQ_PM_DEFINES struct patmgr_info _pm_info |
| 1204 |
#define _SEQ_NEEDBUF(len) \ |
| 1205 |
if ((_seqbufptr+(len)) > _seqbuflen) \ |
| 1206 |
seqbuf_dump() |
| 1207 |
#define _SEQ_ADVBUF(len) _seqbufptr += len |
| 1208 |
#define SEQ_DUMPBUF seqbuf_dump |
| 1209 |
#else |
| 1210 |
|
| 1211 |
|
| 1212 |
|
| 1213 |
|
| 1214 |
|
| 1215 |
|
| 1216 |
|
| 1217 |
|
| 1218 |
|
| 1219 |
|
| 1220 |
|
| 1221 |
|
| 1222 |
|
| 1223 |
|
| 1224 |
#define _SEQ_NEEDBUF(len) |
| 1225 |
#endif |
| 1226 |
|
| 1227 |
#define PM_LOAD_PATCH(dev, bank, pgm) \ |
| 1228 |
(SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \ |
| 1229 |
_pm_info.device=dev, _pm_info.data.data8[0]=pgm, \ |
| 1230 |
_pm_info.parm1 = bank, _pm_info.parm2 = 1, \ |
| 1231 |
ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info)) |
| 1232 |
#define PM_LOAD_PATCHES(dev, bank, pgm) \ |
| 1233 |
(SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \ |
| 1234 |
_pm_info.device=dev, bcopy( pgm, _pm_info.data.data8, 128), \ |
| 1235 |
_pm_info.parm1 = bank, _pm_info.parm2 = 128, \ |
| 1236 |
ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info)) |
| 1237 |
|
| 1238 |
#define SEQ_VOLUME_MODE(dev, mode) { \ |
| 1239 |
_SEQ_NEEDBUF(8);\ |
| 1240 |
_seqbuf[_seqbufptr] = SEQ_EXTENDED;\ |
| 1241 |
_seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\ |
| 1242 |
_seqbuf[_seqbufptr+2] = (dev);\ |
| 1243 |
_seqbuf[_seqbufptr+3] = (mode);\ |
| 1244 |
_seqbuf[_seqbufptr+4] = 0;\ |
| 1245 |
_seqbuf[_seqbufptr+5] = 0;\ |
| 1246 |
_seqbuf[_seqbufptr+6] = 0;\ |
| 1247 |
_seqbuf[_seqbufptr+7] = 0;\ |
| 1248 |
_SEQ_ADVBUF(8);} |
| 1249 |
|
| 1250 |
|
| 1251 |
|
| 1252 |
|
| 1253 |
|
| 1254 |
#define _CHN_VOICE(dev, event, chn, note, parm) { \ |
| 1255 |
_SEQ_NEEDBUF(8);\ |
| 1256 |
_seqbuf[_seqbufptr] = EV_CHN_VOICE;\ |
| 1257 |
_seqbuf[_seqbufptr+1] = (dev);\ |
| 1258 |
_seqbuf[_seqbufptr+2] = (event);\ |
| 1259 |
_seqbuf[_seqbufptr+3] = (chn);\ |
| 1260 |
_seqbuf[_seqbufptr+4] = (note);\ |
| 1261 |
_seqbuf[_seqbufptr+5] = (parm);\ |
| 1262 |
_seqbuf[_seqbufptr+6] = (0);\ |
| 1263 |
_seqbuf[_seqbufptr+7] = 0;\ |
| 1264 |
_SEQ_ADVBUF(8);} |
| 1265 |
|
| 1266 |
#define SEQ_START_NOTE(dev, chn, note, vol) \ |
| 1267 |
_CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol) |
| 1268 |
|
| 1269 |
#define SEQ_STOP_NOTE(dev, chn, note, vol) \ |
| 1270 |
_CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol) |
| 1271 |
|
| 1272 |
#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \ |
| 1273 |
_CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure) |
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
|
| 1278 |
|
| 1279 |
#define _CHN_COMMON(dev, event, chn, p1, p2, w14) { \ |
| 1280 |
_SEQ_NEEDBUF(8);\ |
| 1281 |
_seqbuf[_seqbufptr] = EV_CHN_COMMON;\ |
| 1282 |
_seqbuf[_seqbufptr+1] = (dev);\ |
| 1283 |
_seqbuf[_seqbufptr+2] = (event);\ |
| 1284 |
_seqbuf[_seqbufptr+3] = (chn);\ |
| 1285 |
_seqbuf[_seqbufptr+4] = (p1);\ |
| 1286 |
_seqbuf[_seqbufptr+5] = (p2);\ |
| 1287 |
*(short *)&_seqbuf[_seqbufptr+6] = (w14);\ |
| 1288 |
_SEQ_ADVBUF(8);} |
| 1289 |
|
| 1290 |
|
| 1291 |
|
| 1292 |
|
| 1293 |
|
| 1294 |
|
| 1295 |
|
| 1296 |
|
| 1297 |
|
| 1298 |
|
| 1299 |
|
| 1300 |
|
| 1301 |
|
| 1302 |
|
| 1303 |
|
| 1304 |
#define SEQ_SYSEX(dev, buf, len) { \ |
| 1305 |
int i, l=(len); if (l>6)l=6;\ |
| 1306 |
_SEQ_NEEDBUF(8);\ |
| 1307 |
_seqbuf[_seqbufptr] = EV_SYSEX;\ |
| 1308 |
for(i=0;i<l;i++)_seqbuf[_seqbufptr+i+1] = (buf)[i];\ |
| 1309 |
for(i=l;i<6;i++)_seqbuf[_seqbufptr+i+1] = 0xff;\ |
| 1310 |
_SEQ_ADVBUF(8);} |
| 1311 |
|
| 1312 |
#define SEQ_CHN_PRESSURE(dev, chn, pressure) \ |
| 1313 |
_CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0) |
| 1314 |
|
| 1315 |
#define SEQ_SET_PATCH(dev, chn, patch) \ |
| 1316 |
_CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0) |
| 1317 |
|
| 1318 |
#define SEQ_CONTROL(dev, chn, controller, value) \ |
| 1319 |
_CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value) |
| 1320 |
|
| 1321 |
#define SEQ_BENDER(dev, chn, value) \ |
| 1322 |
_CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value) |
| 1323 |
|
| 1324 |
|
| 1325 |
#define SEQ_V2_X_CONTROL(dev, voice, controller, value) { \ |
| 1326 |
_SEQ_NEEDBUF(8);\ |
| 1327 |
_seqbuf[_seqbufptr] = SEQ_EXTENDED;\ |
| 1328 |
_seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\ |
| 1329 |
_seqbuf[_seqbufptr+2] = (dev);\ |
| 1330 |
_seqbuf[_seqbufptr+3] = (voice);\ |
| 1331 |
_seqbuf[_seqbufptr+4] = (controller);\ |
| 1332 |
*(short *)&_seqbuf[_seqbufptr+5] = (value);\ |
| 1333 |
_seqbuf[_seqbufptr+7] = 0;\ |
| 1334 |
_SEQ_ADVBUF(8);} |
| 1335 |
|
| 1336 |
|
| 1337 |
|
| 1338 |
|
| 1339 |
|
| 1340 |
|
| 1341 |
#define SEQ_PITCHBEND(dev, voice, value) \ |
| 1342 |
SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value) |
| 1343 |
#define SEQ_BENDER_RANGE(dev, voice, value) \ |
| 1344 |
SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value) |
| 1345 |
#define SEQ_EXPRESSION(dev, voice, value) \ |
| 1346 |
SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128) |
| 1347 |
#define SEQ_MAIN_VOLUME(dev, voice, value) \ |
| 1348 |
SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100) |
| 1349 |
#define SEQ_PANNING(dev, voice, pos) \ |
| 1350 |
SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2) |
| 1351 |
|
| 1352 |
|
| 1353 |
|
| 1354 |
|
| 1355 |
|
| 1356 |
#define _TIMER_EVENT(ev, parm) { \ |
| 1357 |
_SEQ_NEEDBUF(8);\ |
| 1358 |
_seqbuf[_seqbufptr+0] = EV_TIMING; \ |
| 1359 |
_seqbuf[_seqbufptr+1] = (ev); \ |
| 1360 |
_seqbuf[_seqbufptr+2] = 0;\ |
| 1361 |
_seqbuf[_seqbufptr+3] = 0;\ |
| 1362 |
*(u_int *)&_seqbuf[_seqbufptr+4] = (parm); \ |
| 1363 |
_SEQ_ADVBUF(8); \ |
| 1364 |
} |
| 1365 |
|
| 1366 |
#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0) |
| 1367 |
#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0) |
| 1368 |
#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0) |
| 1369 |
#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks) |
| 1370 |
#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks) |
| 1371 |
#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key) |
| 1372 |
#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value) |
| 1373 |
#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos) |
| 1374 |
#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig) |
| 1375 |
|
| 1376 |
|
| 1377 |
|
| 1378 |
|
| 1379 |
|
| 1380 |
#define _LOCAL_EVENT(ev, parm) { \ |
| 1381 |
_SEQ_NEEDBUF(8);\ |
| 1382 |
_seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \ |
| 1383 |
_seqbuf[_seqbufptr+1] = (ev); \ |
| 1384 |
_seqbuf[_seqbufptr+2] = 0;\ |
| 1385 |
_seqbuf[_seqbufptr+3] = 0;\ |
| 1386 |
*(u_int *)&_seqbuf[_seqbufptr+4] = (parm); \ |
| 1387 |
_SEQ_ADVBUF(8); \ |
| 1388 |
} |
| 1389 |
|
| 1390 |
#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask) |
| 1391 |
|
| 1392 |
|
| 1393 |
|
| 1394 |
|
| 1395 |
#define SEQ_MIDIOUT(device, byte) { \ |
| 1396 |
_SEQ_NEEDBUF(4);\ |
| 1397 |
_seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\ |
| 1398 |
_seqbuf[_seqbufptr+1] = (byte);\ |
| 1399 |
_seqbuf[_seqbufptr+2] = (device);\ |
| 1400 |
_seqbuf[_seqbufptr+3] = 0;\ |
| 1401 |
_SEQ_ADVBUF(4);} |
| 1402 |
|
| 1403 |
|
| 1404 |
|
| 1405 |
|
| 1406 |
#define SEQ_WRPATCH(patchx, len) { \ |
| 1407 |
if (_seqbufptr) seqbuf_dump(); \ |
| 1408 |
if (write(seqfd, (char*)(patchx), len)==-1) \ |
| 1409 |
perror("Write patch: /dev/sequencer"); \ |
| 1410 |
} |
| 1411 |
|
| 1412 |
#define SEQ_WRPATCH2(patchx, len) \ |
| 1413 |
( seqbuf_dump(), write(seqfd, (char*)(patchx), len) ) |
| 1414 |
|
| 1415 |
#endif |
| 1416 |
|
| 1417 |
|
| 1418 |
|
| 1419 |
|
| 1420 |
|
| 1421 |
#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT |
| 1422 |
#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT |
| 1423 |
#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT |
| 1424 |
|
| 1425 |
#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED |
| 1426 |
#define SOUND_PCM_POST SNDCTL_DSP_POST |
| 1427 |
#define SOUND_PCM_RESET SNDCTL_DSP_RESET |
| 1428 |
#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC |
| 1429 |
#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE |
| 1430 |
#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT |
| 1431 |
#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS |
| 1432 |
#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE |
| 1433 |
#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE |
| 1434 |
#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK |
| 1435 |
#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS |
| 1436 |
#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER |
| 1437 |
#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER |
| 1438 |
#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO |
| 1439 |
#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR |
| 1440 |
#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR |
| 1441 |
#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF |
| 1442 |
#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF |
| 1443 |
|
| 1444 |
|
| 1445 |
|
| 1446 |
|
| 1447 |
|
| 1448 |
|
| 1449 |
|
| 1450 |
|
| 1451 |
|
| 1452 |
|
| 1453 |
|
| 1454 |
|
| 1455 |
|
| 1456 |
|
| 1457 |
|
| 1458 |
|
| 1459 |
|
| 1460 |
|
| 1461 |
|
| 1462 |
|
| 1463 |
#if 0 |
| 1464 |
# define OSSV4_EXPERIMENT 1 |
| 1465 |
#else |
| 1466 |
# undef OSSV4_EXPERIMENT |
| 1467 |
#endif |
| 1468 |
|
| 1469 |
#ifdef SOUND_VERSION |
| 1470 |
# undef SOUND_VERSION |
| 1471 |
# define SOUND_VERSION 0x040000 |
| 1472 |
#endif |
| 1473 |
|
| 1474 |
#define OSS_LONGNAME_SIZE 64 |
| 1475 |
#define OSS_LABEL_SIZE 16 |
| 1476 |
#define OSS_DEVNODE_SIZE 32 |
| 1477 |
typedef char oss_longname_t[OSS_LONGNAME_SIZE]; |
| 1478 |
typedef char oss_label_t[OSS_LABEL_SIZE]; |
| 1479 |
typedef char oss_devnode_t[OSS_DEVNODE_SIZE]; |
| 1480 |
|
| 1481 |
typedef struct audio_errinfo |
| 1482 |
{ |
| 1483 |
int play_underruns; |
| 1484 |
int rec_overruns; |
| 1485 |
unsigned int play_ptradjust; |
| 1486 |
unsigned int rec_ptradjust; |
| 1487 |
int play_errorcount; |
| 1488 |
int rec_errorcount; |
| 1489 |
int play_lasterror; |
| 1490 |
int rec_lasterror; |
| 1491 |
long play_errorparm; |
| 1492 |
long rec_errorparm; |
| 1493 |
int filler[16]; |
| 1494 |
} audio_errinfo; |
| 1495 |
|
| 1496 |
#define SNDCTL_DSP_GETPLAYVOL _IOR ('P', 24, int) |
| 1497 |
#define SNDCTL_DSP_SETPLAYVOL _IOWR('P', 24, int) |
| 1498 |
#define SNDCTL_DSP_GETERROR _IOR ('P', 25, audio_errinfo) |
| 1499 |
|
| 1500 |
|
| 1501 |
|
| 1502 |
|
| 1503 |
|
| 1504 |
|
| 1505 |
typedef struct oss_syncgroup |
| 1506 |
{ |
| 1507 |
int id; |
| 1508 |
int mode; |
| 1509 |
int filler[16]; |
| 1510 |
} oss_syncgroup; |
| 1511 |
|
| 1512 |
#define SNDCTL_DSP_SYNCGROUP _IOWR('P', 28, oss_syncgroup) |
| 1513 |
#define SNDCTL_DSP_SYNCSTART _IOW ('P', 29, int) |
| 1514 |
|
| 1515 |
|
| 1516 |
|
| 1517 |
|
| 1518 |
|
| 1519 |
|
| 1520 |
|
| 1521 |
|
| 1522 |
|
| 1523 |
|
| 1524 |
|
| 1525 |
|
| 1526 |
|
| 1527 |
|
| 1528 |
|
| 1529 |
#define SNDCTL_DSP_COOKEDMODE _IOW ('P', 30, int) |
| 1530 |
|
| 1531 |
|
| 1532 |
|
| 1533 |
|
| 1534 |
|
| 1535 |
|
| 1536 |
|
| 1537 |
#define SNDCTL_DSP_SILENCE _IO ('P', 31) |
| 1538 |
#define SNDCTL_DSP_SKIP _IO ('P', 32) |
| 1539 |
|
| 1540 |
|
| 1541 |
|
| 1542 |
|
| 1543 |
|
| 1544 |
#define SNDCTL_DSP_HALT_INPUT _IO ('P', 33) |
| 1545 |
#define SNDCTL_DSP_RESET_INPUT SNDCTL_DSP_HALT_INPUT |
| 1546 |
#define SNDCTL_DSP_HALT_OUTPUT _IO ('P', 34) |
| 1547 |
#define SNDCTL_DSP_RESET_OUTPUT SNDCTL_DSP_HALT_OUTPUT |
| 1548 |
|
| 1549 |
|
| 1550 |
|
| 1551 |
|
| 1552 |
|
| 1553 |
#define SNDCTL_DSP_LOW_WATER _IOW ('P', 34, int) |
| 1554 |
|
| 1555 |
|
| 1556 |
|
| 1557 |
|
| 1558 |
|
| 1559 |
|
| 1560 |
|
| 1561 |
|
| 1562 |
#ifndef OSS_NO_LONG_LONG |
| 1563 |
typedef struct |
| 1564 |
{ |
| 1565 |
long long samples; |
| 1566 |
int fifo_samples; |
| 1567 |
int filler[32]; |
| 1568 |
} oss_count_t; |
| 1569 |
|
| 1570 |
#define SNDCTL_DSP_CURRENT_IPTR _IOR ('P', 35, oss_count_t) |
| 1571 |
#define SNDCTL_DSP_CURRENT_OPTR _IOR ('P', 36, oss_count_t) |
| 1572 |
#endif |
| 1573 |
|
| 1574 |
|
| 1575 |
|
| 1576 |
|
| 1577 |
|
| 1578 |
#define SNDCTL_DSP_GET_RECSRC_NAMES _IOR ('P', 37, oss_mixer_enuminfo) |
| 1579 |
#define SNDCTL_DSP_GET_RECSRC _IOR ('P', 38, int) |
| 1580 |
#define SNDCTL_DSP_SET_RECSRC _IOWR('P', 38, int) |
| 1581 |
|
| 1582 |
#define SNDCTL_DSP_GET_PLAYTGT_NAMES _IOR ('P', 39, oss_mixer_enuminfo) |
| 1583 |
#define SNDCTL_DSP_GET_PLAYTGT _IOR ('P', 40, int) |
| 1584 |
#define SNDCTL_DSP_SET_PLAYTGT _IOWR('P', 40, int) |
| 1585 |
#define SNDCTL_DSP_GETRECVOL _IOR ('P', 41, int) |
| 1586 |
#define SNDCTL_DSP_SETRECVOL _IOWR('P', 41, int) |
| 1587 |
|
| 1588 |
|
| 1589 |
|
| 1590 |
|
| 1591 |
|
| 1592 |
#define SNDCTL_DSP_GET_CHNORDER _IOR ('P', 42, unsigned long long) |
| 1593 |
#define SNDCTL_DSP_SET_CHNORDER _IOWR('P', 42, unsigned long long) |
| 1594 |
# define CHID_UNDEF 0 |
| 1595 |
# define CHID_L 1 # define CHID_R 2 |
| 1596 |
# define CHID_C 3 |
| 1597 |
# define CHID_LFE 4 |
| 1598 |
# define CHID_LS 5 |
| 1599 |
# define CHID_RS 6 |
| 1600 |
# define CHID_LR 7 |
| 1601 |
# define CHID_RR 8 |
| 1602 |
#define CHNORDER_UNDEF 0x0000000000000000ULL |
| 1603 |
#define CHNORDER_NORMAL 0x0000000087654321ULL |
| 1604 |
|
| 1605 |
#define MAX_PEAK_CHANNELS 128 |
| 1606 |
typedef unsigned short oss_peaks_t[MAX_PEAK_CHANNELS]; |
| 1607 |
#define SNDCTL_DSP_GETIPEAKS _IOR('P', 43, oss_peaks_t) |
| 1608 |
#define SNDCTL_DSP_GETOPEAKS _IOR('P', 44, oss_peaks_t) |
| 1609 |
#define SNDCTL_DSP_POLICY _IOW('P', 45, int) |
| 1610 |
|
| 1611 |
|
| 1612 |
|
| 1613 |
|
| 1614 |
#define OSS_GETVERSION _IOR ('M', 118, int) |
| 1615 |
|
| 1616 |
|
| 1617 |
|
| 1618 |
|
| 1619 |
|
| 1620 |
|
| 1621 |
|
| 1622 |
typedef struct oss_sysinfo |
| 1623 |
{ |
| 1624 |
char product[32]; |
| 1625 |
|
| 1626 |
char version[32]; |
| 1627 |
int versionnum; |
| 1628 |
char options[128]; |
| 1629 |
|
| 1630 |
int numaudios; |
| 1631 |
int openedaudio[8]; |
| 1632 |
|
| 1633 |
|
| 1634 |
int numsynths; |
| 1635 |
int nummidis; |
| 1636 |
int numtimers; |
| 1637 |
int nummixers; |
| 1638 |
|
| 1639 |
int openedmidi[8]; |
| 1640 |
|
| 1641 |
int numcards; |
| 1642 |
int filler[241]; |
| 1643 |
} oss_sysinfo; |
| 1644 |
|
| 1645 |
typedef struct oss_mixext |
| 1646 |
{ |
| 1647 |
int dev; |
| 1648 |
int ctrl; |
| 1649 |
int type; |
| 1650 |
# define MIXT_DEVROOT 0 |
| 1651 |
# define MIXT_GROUP 1 |
| 1652 |
# define MIXT_ONOFF 2 |
| 1653 |
# define MIXT_ENUM 3 |
| 1654 |
# define MIXT_MONOSLIDER 4 |
| 1655 |
# define MIXT_STEREOSLIDER 5 |
| 1656 |
# define MIXT_MESSAGE 6 |
| 1657 |
# define MIXT_MONOVU 7 |
| 1658 |
# define MIXT_STEREOVU 8 |
| 1659 |
# define MIXT_MONOPEAK 9 |
| 1660 |
# define MIXT_STEREOPEAK 10 |
| 1661 |
# define MIXT_RADIOGROUP 11 |
| 1662 |
# define MIXT_MARKER 12 |
| 1663 |
# define MIXT_VALUE 13 |
| 1664 |
# define MIXT_HEXVALUE 14 |
| 1665 |
# define MIXT_MONODB 15 |
| 1666 |
# define MIXT_STEREODB 16 |
| 1667 |
# define MIXT_SLIDER 17 |
| 1668 |
# define MIXT_3D 18 |
| 1669 |
|
| 1670 |
|
| 1671 |
|
| 1672 |
int maxvalue; |
| 1673 |
int minvalue; |
| 1674 |
|
| 1675 |
int flags; |
| 1676 |
# define MIXF_READABLE 0x00000001 |
| 1677 |
# define MIXF_WRITEABLE 0x00000002 |
| 1678 |
# define MIXF_POLL 0x00000004 |
| 1679 |
# define MIXF_HZ 0x00000008 |
| 1680 |
# define MIXF_STRING 0x00000010 |
| 1681 |
# define MIXF_DYNAMIC 0x00000010 |
| 1682 |
# define MIXF_OKFAIL 0x00000020 |
| 1683 |
# define MIXF_FLAT 0x00000040 |
| 1684 |
# define MIXF_LEGACY 0x00000080 |
| 1685 |
char id[16]; |
| 1686 |
int parent; |
| 1687 |
|
| 1688 |
int dummy; |
| 1689 |
|
| 1690 |
int timestamp; |
| 1691 |
|
| 1692 |
char data[64]; |
| 1693 |
unsigned char enum_present[32]; |
| 1694 |
int control_no; |
| 1695 |
|
| 1696 |
|
| 1697 |
|
| 1698 |
|
| 1699 |
|
| 1700 |
|
| 1701 |
unsigned int desc; |
| 1702 |
#define MIXEXT_SCOPE_MASK 0x0000003f |
| 1703 |
#define MIXEXT_SCOPE_OTHER 0x00000000 |
| 1704 |
#define MIXEXT_SCOPE_INPUT 0x00000001 |
| 1705 |
#define MIXEXT_SCOPE_OUTPUT 0x00000002 |
| 1706 |
#define MIXEXT_SCOPE_MONITOR 0x00000003 |
| 1707 |
#define MIXEXT_SCOPE_RECSWITCH 0x00000004 |
| 1708 |
|
| 1709 |
char extname[32]; |
| 1710 |
int update_counter; |
| 1711 |
int filler[7]; |
| 1712 |
} oss_mixext; |
| 1713 |
|
| 1714 |
typedef struct oss_mixext_root |
| 1715 |
{ |
| 1716 |
char id[16]; |
| 1717 |
char name[48]; |
| 1718 |
} oss_mixext_root; |
| 1719 |
|
| 1720 |
typedef struct oss_mixer_value |
| 1721 |
{ |
| 1722 |
int dev; |
| 1723 |
int ctrl; |
| 1724 |
int value; |
| 1725 |
int flags; |
| 1726 |
int timestamp; |
| 1727 |
int filler[8]; |
| 1728 |
} oss_mixer_value; |
| 1729 |
|
| 1730 |
#define OSS_ENUM_MAXVALUE 255 |
| 1731 |
typedef struct oss_mixer_enuminfo |
| 1732 |
{ |
| 1733 |
int dev; |
| 1734 |
int ctrl; |
| 1735 |
int nvalues; |
| 1736 |
int version; |
| 1737 |
short strindex[OSS_ENUM_MAXVALUE]; |
| 1738 |
char strings[3000]; |
| 1739 |
} oss_mixer_enuminfo; |
| 1740 |
|
| 1741 |
#define OPEN_READ PCM_ENABLE_INPUT |
| 1742 |
#define OPEN_WRITE PCM_ENABLE_OUTPUT |
| 1743 |
#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE) |
| 1744 |
|
| 1745 |
|
| 1746 |
|
| 1747 |
|
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
typedef struct oss_audioinfo |
| 1752 |
{ |
| 1753 |
int dev; |
| 1754 |
char name[64]; |
| 1755 |
int busy; |
| 1756 |
int pid; |
| 1757 |
int caps; |
| 1758 |
int iformats; |
| 1759 |
int oformats; |
| 1760 |
int magic; |
| 1761 |
char cmd[64]; |
| 1762 |
int card_number; |
| 1763 |
int port_number; |
| 1764 |
int mixer_dev; |
| 1765 |
int real_device; |
| 1766 |
int enabled; |
| 1767 |
|
| 1768 |
int flags; |
| 1769 |
|
| 1770 |
int min_rate; |
| 1771 |
int max_rate; |
| 1772 |
int min_channels; |
| 1773 |
int max_channels; |
| 1774 |
int binding; |
| 1775 |
int rate_source; |
| 1776 |
char handle[32]; |
| 1777 |
#define OSS_MAX_SAMPLE_RATES 20 |
| 1778 |
unsigned int nrates; |
| 1779 |
unsigned int rates[OSS_MAX_SAMPLE_RATES]; |
| 1780 |
oss_longname_t song_name; |
| 1781 |
oss_label_t label; |
| 1782 |
int latency; |
| 1783 |
oss_devnode_t devnode; |
| 1784 |
|
| 1785 |
int filler[186]; |
| 1786 |
} oss_audioinfo; |
| 1787 |
|
| 1788 |
typedef struct oss_mixerinfo |
| 1789 |
{ |
| 1790 |
int dev; |
| 1791 |
char id[16]; |
| 1792 |
char name[32]; |
| 1793 |
int modify_counter; |
| 1794 |
int card_number; |
| 1795 |
int port_number; |
| 1796 |
char handle[32]; |
| 1797 |
int magic; |
| 1798 |
int enabled; |
| 1799 |
int caps; |
| 1800 |
#define MIXER_CAP_VIRTUAL 0x00000001 |
| 1801 |
int flags; |
| 1802 |
int nrext; |
| 1803 |
|
| 1804 |
|
| 1805 |
|
| 1806 |
|
| 1807 |
|
| 1808 |
|
| 1809 |
int priority; |
| 1810 |
int filler[254]; |
| 1811 |
} oss_mixerinfo; |
| 1812 |
|
| 1813 |
typedef struct oss_midi_info |
| 1814 |
{ |
| 1815 |
int dev; |
| 1816 |
char name[64]; |
| 1817 |
int busy; |
| 1818 |
int pid; |
| 1819 |
char cmd[64]; |
| 1820 |
int caps; |
| 1821 |
#define MIDI_CAP_MPU401 0x00000001 |
| 1822 |
#define MIDI_CAP_INPUT 0x00000002 |
| 1823 |
#define MIDI_CAP_OUTPUT 0x00000004 |
| 1824 |
#define MIDI_CAP_INOUT (MIDI_CAP_INPUT|MIDI_CAP_OUTPUT) |
| 1825 |
#define MIDI_CAP_VIRTUAL 0x00000008 |
| 1826 |
#define MIDI_CAP_MTCINPUT 0x00000010 |
| 1827 |
#define MIDI_CAP_CLIENT 0x00000020 |
| 1828 |
#define MIDI_CAP_SERVER 0x00000040 |
| 1829 |
#define MIDI_CAP_INTERNAL 0x00000080 |
| 1830 |
#define MIDI_CAP_EXTERNAL 0x00000100 |
| 1831 |
#define MIDI_CAP_PTOP 0x00000200 |
| 1832 |
#define MIDI_CAP_MTC 0x00000400 |
| 1833 |
int magic; |
| 1834 |
int card_number; |
| 1835 |
int port_number; |
| 1836 |
int enabled; |
| 1837 |
int flags; |
| 1838 |
char handle[32]; |
| 1839 |
oss_longname_t song_name; |
| 1840 |
oss_label_t label; |
| 1841 |
int latency; |
| 1842 |
int filler[244]; |
| 1843 |
} oss_midi_info; |
| 1844 |
|
| 1845 |
typedef struct oss_card_info |
| 1846 |
{ |
| 1847 |
int card; |
| 1848 |
char shortname[16]; |
| 1849 |
char longname[128]; |
| 1850 |
int flags; |
| 1851 |
int filler[256]; |
| 1852 |
} oss_card_info; |
| 1853 |
|
| 1854 |
#define SNDCTL_SYSINFO _IOR ('X', 1, oss_sysinfo) |
| 1855 |
#define OSS_SYSINFO SNDCTL_SYSINFO |
| 1856 |
|
| 1857 |
#define SNDCTL_MIX_NRMIX _IOR ('X', 2, int) |
| 1858 |
#define SNDCTL_MIX_NREXT _IOWR('X', 3, int) |
| 1859 |
#define SNDCTL_MIX_EXTINFO _IOWR('X', 4, oss_mixext) |
| 1860 |
#define SNDCTL_MIX_READ _IOWR('X', 5, oss_mixer_value) |
| 1861 |
#define SNDCTL_MIX_WRITE _IOWR('X', 6, oss_mixer_value) |
| 1862 |
|
| 1863 |
#define SNDCTL_AUDIOINFO _IOWR('X', 7, oss_audioinfo) |
| 1864 |
#define SNDCTL_MIX_ENUMINFO _IOWR('X', 8, oss_mixer_enuminfo) |
| 1865 |
#define SNDCTL_MIDIINFO _IOWR('X', 9, oss_midi_info) |
| 1866 |
#define SNDCTL_MIXERINFO _IOWR('X',10, oss_mixerinfo) |
| 1867 |
#define SNDCTL_CARDINFO _IOWR('X',11, oss_card_info) |
| 1868 |
|
| 1869 |
|
| 1870 |
|
| 1871 |
|
| 1872 |
#define SNDCTL_SETSONG _IOW ('Y', 2, oss_longname_t) |
| 1873 |
#define SNDCTL_GETSONG _IOR ('Y', 2, oss_longname_t) |
| 1874 |
#define SNDCTL_SETNAME _IOW ('Y', 3, oss_longname_t) |
| 1875 |
#define SNDCTL_SETLABEL _IOW ('Y', 4, oss_label_t) |
| 1876 |
#define SNDCTL_GETLABEL _IOR ('Y', 4, oss_label_t) |
| 1877 |
|
| 1878 |
#endif |