Changeset 3244:cb520c8f0212 in roaraudio for libroaross/libroaross.c
- Timestamp:
- 01/29/10 19:41:38 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroaross/libroaross.c
r3243 r3244 99 99 #define HT_STREAM 1 100 100 #define HT_MIXER 2 101 #define HT_WAVEFORM 3 102 #define HT_MIDI 4 101 103 102 104 struct session { … … 359 361 int type; 360 362 } * ptr = NULL, p[] = { 361 {"/dev/dsp", HT_ STREAM},362 {"/dev/audio", HT_ STREAM},363 {"/dev/sound/dsp", HT_ STREAM},364 {"/dev/sound/audio", HT_ STREAM},363 {"/dev/dsp", HT_WAVEFORM}, 364 {"/dev/audio", HT_WAVEFORM}, 365 {"/dev/sound/dsp", HT_WAVEFORM}, 366 {"/dev/sound/audio", HT_WAVEFORM}, 365 367 {"/dev/mixer", HT_MIXER}, 366 368 {"/dev/sound/mixer", HT_MIXER}, 369 {"/dev/midi", HT_MIDI}, 367 370 #ifdef ROAR_DEFAULT_OSS_DEV 368 {ROAR_DEFAULT_OSS_DEV, HT_ STREAM},371 {ROAR_DEFAULT_OSS_DEV, HT_WAVEFORM}, 369 372 #endif 370 373 {NULL, HT_NONE}, … … 390 393 } 391 394 392 handle->type = ptr->type; 395 handle->type = ptr->type; 396 handle->stream_dir = -1; 393 397 394 398 switch (flags & (O_RDONLY|O_WRONLY|O_RDWR)) { 395 399 case O_RDONLY: 396 handle->stream_dir = ROAR_DIR_MONITOR; 400 switch (ptr->type) { 401 case HT_WAVEFORM: 402 handle->stream_dir = ROAR_DIR_MONITOR; 403 break; 404 case HT_MIDI: 405 handle->stream_dir = ROAR_DIR_MIDI_OUT; 406 break; 407 } 397 408 break; 398 409 case O_WRONLY: 399 handle->stream_dir = ROAR_DIR_PLAY; 410 switch (ptr->type) { 411 case HT_WAVEFORM: 412 handle->stream_dir = ROAR_DIR_PLAY; 413 break; 414 case HT_MIDI: 415 handle->stream_dir = ROAR_DIR_MIDI_IN; 416 break; 417 } 400 418 break; 401 419 case O_RDWR: 402 handle->stream_dir = ROAR_DIR_BIDIR; 420 switch (ptr->type) { 421 case HT_WAVEFORM: 422 handle->stream_dir = ROAR_DIR_BIDIR; 423 break; 424 } 425 break; 426 } 427 428 switch (handle->type) { 429 case HT_WAVEFORM: 430 handle->type = HT_STREAM; 431 break; 432 case HT_MIDI: 433 handle->type = HT_STREAM; 434 handle->stream.info.rate = 0; 435 handle->stream.info.bits = ROAR_MIDI_BITS; 436 handle->stream.info.channels = ROAR_MIDI_CHANNELS_DEFAULT; 437 handle->stream.info.codec = ROAR_CODEC_MIDI; 403 438 break; 404 439 }
Note: See TracChangeset
for help on using the changeset viewer.