4 #include <exec/execbase.h>
5 #include <proto/exec.h>
8 //#include "ahi_device.h"
10 extern struct ExecBase
*SysBase
;
12 void printlist(struct MinList
*);
16 struct AHIBase
*AHIBase
;
17 struct AHIDevUnit
*iounit
;
20 AHIBase
= (struct AHIBase
*) FindName(& SysBase
->DeviceList
, AHINAME
);
23 printf("Base: 0x%08lx\n", AHIBase
);
27 iounit
= AHIBase
->ahib_DevUnits
[0];
28 printf("iounit 0: 0x%08lx\n", iounit
);
32 printf("Is playing.\n");
34 if(iounit
->IsRecording
)
35 printf("Is recording.\n");
38 printlist(&iounit
->ReadList
);
39 printf("PlayingList\n");
40 printlist(&iounit
->PlayingList
);
41 printf("SilentList\n");
42 printlist(&iounit
->SilentList
);
43 printf("WaitingList\n");
44 printlist(&iounit
->WaitingList
);
46 printf("S: %ld, R: %ld, R:%ld\n", iounit
->SampleSignal
,
47 iounit
->RecordSignal
, iounit
->PlaySignal
);
50 iounit
= AHIBase
->ahib_DevUnits
[1];
51 printf("iounit 1: 0x%08lx\n", iounit
);
55 printf("Is playing.\n");
57 if(iounit
->IsRecording
)
58 printf("Is recording.\n");
61 printlist(&iounit
->ReadList
);
62 printf("PlayingList\n");
63 printlist(&iounit
->PlayingList
);
64 printf("SilentList\n");
65 printlist(&iounit
->SilentList
);
66 printf("WaitingList\n");
67 printlist(&iounit
->WaitingList
);
69 printf("S: %ld, R: %ld, R:%ld\n", iounit
->SampleSignal
,
70 iounit
->RecordSignal
, iounit
->PlaySignal
);
76 const static char * commands
[] =
89 void printlist(struct MinList
*list
)
91 struct AHIRequest
*ioreq
;
93 ioreq
= (struct AHIRequest
*) list
->mlh_Head
;
94 while (ioreq
->ahir_Std
.io_Message
.mn_Node
.ln_Succ
)
96 printf("iorequest: 0x%08lx\n", ioreq
);
97 printf("command : %s (0x%lx)\n",
98 (ioreq
->ahir_Std
.io_Command
< CMD_NONSTD
?
99 commands
[ioreq
->ahir_Std
.io_Command
] :
101 ioreq
->ahir_Std
.io_Command
);
102 ioreq
= (struct AHIRequest
*) ioreq
->ahir_Std
.io_Message
.mn_Node
.ln_Succ
;