grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / AHI / AHI-Handler / main.h
blobfdbd43c269fedf93cf452efaa842cba652b5505e
2 #include <devices/ahi.h>
4 #if !defined (__mc68000__) && defined (__GNUC__)
5 # pragma pack(2)
6 #endif
8 struct HandlerData {
9 BOOL initialized; // TRUE if structure initialized, else FALSE
10 BOOL writing; // TRUE if writing, FALSE otherwise
11 UBYTE *buffer1; // Address of read buffer
12 UBYTE *buffer2;
13 LONG length; // Offset to first invalid sample frame
14 LONG offset; // Current pointer
15 struct AHIRequest *readreq; // IO Request used for reading
16 struct AHIRequest *writereq1; // IO Request used for writing
17 struct AHIRequest *writereq2; // IO Request used for writing
18 ULONG bits;
19 ULONG channels;
20 ULONG type;
21 ULONG freq;
22 Fixed vol;
23 sposition pos;
24 LONG priority;
25 LONG totallength; // Total number of bytes to play/record
26 LONG buffersize; // Play/record buffer size
27 UBYTE format; // See definition below.
29 struct RDArgs *rdargs;
30 struct RDArgs *rdargs2;
31 struct {
32 ULONG *bits;
33 ULONG *channels;
34 ULONG *freq;
35 STRPTR type;
36 Fixed *volume;
37 sposition *position;
38 LONG *priority;
39 LONG *length;
40 LONG *seconds;
41 LONG *buffersize;
42 LONG *unit;
44 UWORD format;
45 } args;
49 #define SIGNED 1
50 #define AIFF 2
51 #define AIFC 3
54 /* AIFF and AIFC defines was taken from Olaf `Olsen' Barthel's AIFF DataType. */
56 // 80 bit IEEE Standard 754 floating point number
58 typedef struct {
59 unsigned short exponent; // Exponent, bit #15 is sign bit for mantissa
60 unsigned long mantissa[2]; // 64 bit mantissa
61 } extended;
63 // Audio Interchange Format chunk data
65 #define ID_AIFF MAKE_ID('A','I','F','F')
66 #define ID_AIFC MAKE_ID('A','I','F','C')
68 #define ID_FVER MAKE_ID('F','V','E','R')
69 #define ID_COMM MAKE_ID('C','O','M','M')
70 #define ID_SSND MAKE_ID('S','S','N','D')
72 // "COMM" chunk header
74 typedef struct {
75 short numChannels; // Number of channels
76 unsigned long numSampleFrames; // Number of sample frames
77 short sampleSize; // Number of bits per sample point
78 extended sampleRate; // Replay rate in samples per second
79 } CommonChunk;
81 // The same for "AIFC" type files
83 #define NO_COMPRESSION MAKE_ID('N','O','N','E') // No sound compression
85 typedef struct {
86 short numChannels; // Number of channels
87 unsigned long numSampleFrames; // Number of sample frames
88 short sampleSize; // Number of bits per sample point
89 extended sampleRate; // Replay rate in samples per second
90 unsigned long compressionType; // Compression type
91 char compressionName[(sizeof("not compressed")+1)&(~1)];
92 } ExtCommonChunk;
95 // "SSND" chunk header
97 typedef struct {
98 unsigned long offset, // Offset to sound data, for block alignment
99 blockSize; // Size of block data is aligned to
100 } SampledSoundHeader;
102 // "FVER" chunk header
104 typedef struct {
105 long timestamp; // Format version creation date
106 } FormatVersionHeader;
108 #define AIFCVersion1 0xA2805140 // "AIFC" file format version #1
111 struct AIFCHeader {
112 ULONG FORMid;
113 ULONG FORMsize;
114 ULONG AIFCid;
116 ULONG FVERid;
117 ULONG FVERsize;
118 FormatVersionHeader FVERchunk;
120 ULONG COMMid;
121 ULONG COMMsize;
122 ExtCommonChunk COMMchunk;
124 ULONG SSNDid;
125 ULONG SSNDsize;
126 SampledSoundHeader SSNDchunk;
129 struct AIFFHeader {
130 ULONG FORMid;
131 ULONG FORMsize;
132 ULONG AIFFid;
134 ULONG COMMid;
135 ULONG COMMsize;
136 CommonChunk COMMchunk;
138 ULONG SSNDid;
139 ULONG SSNDsize;
140 SampledSoundHeader SSNDchunk;
143 #if !defined (__mc68000__) && defined (__GNUC__)
144 # pragma pack()
145 #endif