470 |
|
return badComponentSelector; |
471 |
|
} |
472 |
|
} |
473 |
+ |
|
474 |
+ |
|
475 |
+ |
/* |
476 |
+ |
* Sound input driver Open() routine |
477 |
+ |
*/ |
478 |
+ |
|
479 |
+ |
int16 SoundInOpen(uint32 pb, uint32 dce) |
480 |
+ |
{ |
481 |
+ |
D(bug("SoundInOpen\n")); |
482 |
+ |
return noErr; |
483 |
+ |
} |
484 |
+ |
|
485 |
+ |
|
486 |
+ |
/* |
487 |
+ |
* Sound input driver Prime() routine |
488 |
+ |
*/ |
489 |
+ |
|
490 |
+ |
int16 SoundInPrime(uint32 pb, uint32 dce) |
491 |
+ |
{ |
492 |
+ |
D(bug("SoundInPrime\n")); |
493 |
+ |
//!! |
494 |
+ |
return paramErr; |
495 |
+ |
} |
496 |
+ |
|
497 |
+ |
|
498 |
+ |
/* |
499 |
+ |
* Sound input driver Control() routine |
500 |
+ |
*/ |
501 |
+ |
|
502 |
+ |
int16 SoundInControl(uint32 pb, uint32 dce) |
503 |
+ |
{ |
504 |
+ |
uint16 code = ReadMacInt16(pb + csCode); |
505 |
+ |
D(bug("SoundInControl %d\n", code)); |
506 |
+ |
|
507 |
+ |
if (code == 1) { |
508 |
+ |
D(bug(" SoundInKillIO\n")); |
509 |
+ |
//!! |
510 |
+ |
return noErr; |
511 |
+ |
} |
512 |
+ |
|
513 |
+ |
if (code != 2) |
514 |
+ |
return -231; // siUnknownInfoType |
515 |
+ |
|
516 |
+ |
uint32 *param = (uint32 *)Mac2HostAddr(pb + csParam); |
517 |
+ |
uint32 selector = param[0]; |
518 |
+ |
D(bug(" selector %c%c%c%c\n", selector >> 24, selector >> 16, selector >> 8, selector)); |
519 |
+ |
|
520 |
+ |
switch (selector) { |
521 |
+ |
default: |
522 |
+ |
return -231; // siUnknownInfoType |
523 |
+ |
} |
524 |
+ |
} |
525 |
+ |
|
526 |
+ |
|
527 |
+ |
/* |
528 |
+ |
* Sound input driver Status() routine |
529 |
+ |
*/ |
530 |
+ |
|
531 |
+ |
int16 SoundInStatus(uint32 pb, uint32 dce) |
532 |
+ |
{ |
533 |
+ |
uint16 code = ReadMacInt16(pb + csCode); |
534 |
+ |
D(bug("SoundInStatus %d\n", code)); |
535 |
+ |
if (code != 2) |
536 |
+ |
return -231; // siUnknownInfoType |
537 |
+ |
|
538 |
+ |
uint32 *param = (uint32 *)Mac2HostAddr(pb + csParam); |
539 |
+ |
uint32 selector = param[0]; |
540 |
+ |
D(bug(" selector %c%c%c%c\n", selector >> 24, selector >> 16, selector >> 8, selector)); |
541 |
+ |
switch (selector) { |
542 |
+ |
#if 0 |
543 |
+ |
case siDeviceName: { |
544 |
+ |
const char *str = GetString(STR_SOUND_IN_NAME); |
545 |
+ |
param[0] = 0; |
546 |
+ |
memcpy((void *)param[1], str, strlen(str)); |
547 |
+ |
return noErr; |
548 |
+ |
} |
549 |
+ |
|
550 |
+ |
case siDeviceIcon: { |
551 |
+ |
M68kRegisters r; |
552 |
+ |
static const uint16 proc[] = { |
553 |
+ |
0x558f, // subq.l #2,sp |
554 |
+ |
0xa994, // CurResFile |
555 |
+ |
0x4267, // clr.w -(sp) |
556 |
+ |
0xa998, // UseResFile |
557 |
+ |
0x598f, // subq.l #4,sp |
558 |
+ |
0x4879, 0x4943, 0x4e23, // move.l #'ICN#',-(sp) |
559 |
+ |
0x3f3c, 0xbf76, // move.w #-16522,-(sp) |
560 |
+ |
0xa9a0, // GetResource |
561 |
+ |
0x245f, // move.l (sp)+,a2 |
562 |
+ |
0xa998, // UseResFile |
563 |
+ |
0x200a, // move.l a2,d0 |
564 |
+ |
0x6604, // bne 1 |
565 |
+ |
0x7000, // moveq #0,d0 |
566 |
+ |
M68K_RTS, |
567 |
+ |
0x2f0a, //1 move.l a2,-(sp) |
568 |
+ |
0xa992, // DetachResource |
569 |
+ |
0x204a, // move.l a2,a0 |
570 |
+ |
0xa04a, // HNoPurge |
571 |
+ |
0x7001, // moveq #1,d0 |
572 |
+ |
M68K_RTS |
573 |
+ |
}; |
574 |
+ |
Execute68k((uint32)proc, &r); |
575 |
+ |
if (r.d[0]) { |
576 |
+ |
param[0] = 4; // Length of returned data |
577 |
+ |
param[1] = r.a[2]; // Handle to icon suite |
578 |
+ |
return noErr; |
579 |
+ |
} else |
580 |
+ |
return -192; // resNotFound |
581 |
+ |
} |
582 |
+ |
#endif |
583 |
+ |
default: |
584 |
+ |
return -231; // siUnknownInfoType |
585 |
+ |
} |
586 |
+ |
} |
587 |
+ |
|
588 |
+ |
|
589 |
+ |
/* |
590 |
+ |
* Sound input driver Close() routine |
591 |
+ |
*/ |
592 |
+ |
|
593 |
+ |
int16 SoundInClose(uint32 pb, uint32 dce) |
594 |
+ |
{ |
595 |
+ |
D(bug("SoundInClose\n")); |
596 |
+ |
return noErr; |
597 |
+ |
} |