Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / diskimage / include / devices / ahi.h
blob705565c91348fd49749fecac0c88fc06acef7de3
1 #ifndef DEVICES_AHI_H
2 #define DEVICES_AHI_H
4 /*
5 ** $VER: ahi.h 5.1 (3.6.00)
6 **
7 ** ahi.device definitions
8 **
9 ** (C) Copyright 1994-2000 Martin Blom
10 ** All Rights Reserved.
12 ** (TAB SIZE: 8)
15 /*****************************************************************************/
17 #ifndef EXEC_TYPES_H
18 #include <exec/types.h>
19 #endif
21 #ifndef EXEC_IO_H
22 #include <exec/io.h>
23 #endif
25 #ifndef UTILITY_TAGITEM_H
26 #include <utility/tagitem.h>
27 #endif
29 #ifndef LIBRARIES_IFFPARSE_H
30 #include <libraries/iffparse.h>
31 #endif
33 /****************************************************************************/
35 #ifdef __cplusplus
36 #ifdef __USE_AMIGAOS_NAMESPACE__
37 namespace AmigaOS {
38 #endif
39 extern "C" {
40 #endif
42 #ifdef __GNUC__
43 #ifdef __PPC__
44 #pragma pack(2)
45 #endif
46 #elif defined(__VBCC__)
47 #pragma amiga-align
48 #endif
50 /****************************************************************************/
52 #ifndef EIGHTSVX_H /* Do not define Fixed twice */
54 typedef LONG Fixed; /* A fixed-point value, 16 bits
55 to the left of the point and
56 16 bits to the right */
57 #endif
58 typedef Fixed sposition;
60 /*** STRUCTURES */
62 /* AHIAudioCtrl */
63 struct AHIAudioCtrl
65 APTR ahiac_UserData;
66 /* Lots of private data follows! */
69 /* AHISoundMessage */
70 struct AHISoundMessage
72 UWORD ahism_Channel;
75 /* AHIRecordMessage */
76 struct AHIRecordMessage
78 ULONG ahirm_Type; /* Format of buffer (object) */
79 APTR ahirm_Buffer; /* Pointer to the sample array */
80 ULONG ahirm_Length; /* Number of sample frames in buffer */
83 /* AHISampleInfo */
84 struct AHISampleInfo
86 ULONG ahisi_Type; /* Format of samples */
87 APTR ahisi_Address; /* Address to array of samples */
88 ULONG ahisi_Length; /* Number of samples in array */
92 /* AHIAudioModeRequester */
93 struct AHIAudioModeRequester
95 ULONG ahiam_AudioID; /* Selected audio mode */
96 ULONG ahiam_MixFreq; /* Selected mixing/sampling frequency */
98 WORD ahiam_LeftEdge; /* Coordinates of requester on exit */
99 WORD ahiam_TopEdge;
100 WORD ahiam_Width;
101 WORD ahiam_Height;
103 BOOL ahiam_InfoOpened; /* Info window opened on exit? */
104 WORD ahiam_InfoLeftEdge; /* Last coordinates of Info window */
105 WORD ahiam_InfoTopEdge;
106 WORD ahiam_InfoWidth;
107 WORD ahiam_InfoHeight;
109 UWORD ahiam_ObsoleteUserData[2];
110 UWORD ahiam_Pad;
111 APTR ahiam_UserData; /* You can store your own data here (V5) */
112 /* Lots of private data follows! */
115 /* AHIEffMasterVolume */
116 struct AHIEffMasterVolume
118 ULONG ahie_Effect; /* Set to AHIET_MASTERVOLUME */
119 Fixed ahiemv_Volume; /* See autodocs for range! */
122 /* AHIEffOutputBuffer */
123 struct AHIEffOutputBuffer
125 ULONG ahie_Effect; /* Set to AHIET_OUTPUTBUFFER */
126 struct Hook *ahieob_Func;
127 /* These fields are filled by AHI */
128 ULONG ahieob_Type; /* Format of buffer */
129 APTR ahieob_Buffer; /* Pointer to the sample array */
130 ULONG ahieob_Length; /* Number of sample frames in buffer */
133 /* AHIEffDSPMask (V4) */
134 struct AHIEffDSPMask
136 ULONG ahie_Effect; /* Set to AHIET_DSPMASK */
137 UWORD ahiedm_Channels; /* Number of elements in array */
138 UBYTE ahiedm_Mask[]; /* Here follows the array */
141 #define AHIEDM_WET (0)
142 #define AHIEDM_DRY (1)
144 /* AHIEffDSPEcho (V4) */
145 struct AHIEffDSPEcho
147 ULONG ahie_Effect; /* Set to AHIET_DSPECHO */
148 ULONG ahiede_Delay; /* In samples */
149 Fixed ahiede_Feedback;
150 Fixed ahiede_Mix;
151 Fixed ahiede_Cross;
154 #define AHIDSPEcho AHIEffDSPEcho /* Fix for error in V4 includes */
156 /* AHIEffChannelInfo (V4) */
158 struct AHIEffChannelInfo
160 ULONG ahie_Effect; /* Set to AHIET_CHANNELINFO */
161 struct Hook *ahieci_Func;
162 UWORD ahieci_Channels;
163 UWORD ahieci_Pad;
164 /* The rest is filled by AHI */
165 ULONG ahieci_Offset[]; /* The array follows */
168 /*** TAGS */
170 #define AHI_TagBase (TAG_USER)
171 #define AHI_TagBaseR (AHI_TagBase|0x8000)
173 /* AHI_AllocAudioA tags */
174 #define AHIA_AudioID (AHI_TagBase+1) /* Desired audio mode */
175 #define AHIA_MixFreq (AHI_TagBase+2) /* Suggested mixing frequency */
176 #define AHIA_Channels (AHI_TagBase+3) /* Suggested number of channels */
177 #define AHIA_Sounds (AHI_TagBase+4) /* Number of sounds to use */
178 #define AHIA_SoundFunc (AHI_TagBase+5) /* End-of-Sound Hook */
179 #define AHIA_PlayerFunc (AHI_TagBase+6) /* Player Hook */
180 #define AHIA_PlayerFreq (AHI_TagBase+7) /* Frequency for player Hook (Fixed)*/
181 #define AHIA_MinPlayerFreq (AHI_TagBase+8) /* Minimum Frequency for player Hook */
182 #define AHIA_MaxPlayerFreq (AHI_TagBase+9) /* Maximum Frequency for player Hook */
183 #define AHIA_RecordFunc (AHI_TagBase+10) /* Sample recording Hook */
184 #define AHIA_UserData (AHI_TagBase+11) /* What to put in ahiac_UserData */
185 #define AHIA_AntiClickSamples (AHI_TagBase+13) /* # of samples to smooth (V5) */
187 /* AHI_PlayA tags (V4) */
188 #define AHIP_BeginChannel (AHI_TagBase+40) /* All command tags should be... */
189 #define AHIP_EndChannel (AHI_TagBase+41) /* ... enclosed by these tags. */
190 #define AHIP_Freq (AHI_TagBase+50)
191 #define AHIP_Vol (AHI_TagBase+51)
192 #define AHIP_Pan (AHI_TagBase+52)
193 #define AHIP_Sound (AHI_TagBase+53)
194 #define AHIP_Offset (AHI_TagBase+54)
195 #define AHIP_Length (AHI_TagBase+55)
196 #define AHIP_LoopFreq (AHI_TagBase+60)
197 #define AHIP_LoopVol (AHI_TagBase+61)
198 #define AHIP_LoopPan (AHI_TagBase+62)
199 #define AHIP_LoopSound (AHI_TagBase+63)
200 #define AHIP_LoopOffset (AHI_TagBase+64)
201 #define AHIP_LoopLength (AHI_TagBase+65)
203 /* AHI_ControlAudioA tags */
204 #define AHIC_Play (AHI_TagBase+80) /* Boolean */
205 #define AHIC_Record (AHI_TagBase+81) /* Boolean */
206 #define AHIC_MonitorVolume (AHI_TagBase+82)
207 #define AHIC_MonitorVolume_Query (AHI_TagBase+83) /* ti_Data is pointer to Fixed (LONG) */
208 #define AHIC_MixFreq_Query (AHI_TagBase+84) /* ti_Data is pointer to ULONG */
209 /* --- New for V2, they will be ignored by V1 --- */
210 #define AHIC_InputGain (AHI_TagBase+85)
211 #define AHIC_InputGain_Query (AHI_TagBase+86) /* ti_Data is pointer to Fixed (LONG) */
212 #define AHIC_OutputVolume (AHI_TagBase+87)
213 #define AHIC_OutputVolume_Query (AHI_TagBase+88) /* ti_Data is pointer to Fixed (LONG) */
214 #define AHIC_Input (AHI_TagBase+89)
215 #define AHIC_Input_Query (AHI_TagBase+90) /* ti_Data is pointer to ULONG */
216 #define AHIC_Output (AHI_TagBase+91)
217 #define AHIC_Output_Query (AHI_TagBase+92) /* ti_Data is pointer to ULONG */
219 /* AHI_GetAudioAttrsA tags */
220 #define AHIDB_AudioID (AHI_TagBase+100)
221 #define AHIDB_Driver (AHI_TagBaseR+101) /* Pointer to name of driver */
222 #define AHIDB_Flags (AHI_TagBase+102) /* Private! */
223 #define AHIDB_Volume (AHI_TagBase+103) /* Boolean */
224 #define AHIDB_Panning (AHI_TagBase+104) /* Boolean */
225 #define AHIDB_Stereo (AHI_TagBase+105) /* Boolean */
226 #define AHIDB_HiFi (AHI_TagBase+106) /* Boolean */
227 #define AHIDB_PingPong (AHI_TagBase+107) /* Boolean */
228 #define AHIDB_MultTable (AHI_TagBase+108) /* Private! */
229 #define AHIDB_Name (AHI_TagBaseR+109) /* Pointer to name of this mode */
230 #define AHIDB_Bits (AHI_TagBase+110) /* Output bits */
231 #define AHIDB_MaxChannels (AHI_TagBase+111) /* Max supported channels */
232 #define AHIDB_MinMixFreq (AHI_TagBase+112) /* Min mixing freq. supported */
233 #define AHIDB_MaxMixFreq (AHI_TagBase+113) /* Max mixing freq. supported */
234 #define AHIDB_Record (AHI_TagBase+114) /* Boolean */
235 #define AHIDB_Frequencies (AHI_TagBase+115)
236 #define AHIDB_FrequencyArg (AHI_TagBase+116) /* ti_Data is frequency index */
237 #define AHIDB_Frequency (AHI_TagBase+117)
238 #define AHIDB_Author (AHI_TagBase+118) /* Pointer to driver author name */
239 #define AHIDB_Copyright (AHI_TagBase+119) /* Pointer to driver copyright notice */
240 #define AHIDB_Version (AHI_TagBase+120) /* Pointer to driver version string */
241 #define AHIDB_Annotation (AHI_TagBase+121) /* Pointer to driver annotation text */
242 #define AHIDB_BufferLen (AHI_TagBase+122) /* Specifies the string buffer size */
243 #define AHIDB_IndexArg (AHI_TagBase+123) /* ti_Data is frequency! */
244 #define AHIDB_Index (AHI_TagBase+124)
245 #define AHIDB_Realtime (AHI_TagBase+125) /* Boolean */
246 #define AHIDB_MaxPlaySamples (AHI_TagBase+126) /* It's sample *frames* */
247 #define AHIDB_MaxRecordSamples (AHI_TagBase+127) /* It's sample *frames* */
248 #define AHIDB_FullDuplex (AHI_TagBase+129) /* Boolean */
249 /* --- New for V2, they will be ignored by V1 --- */
250 #define AHIDB_MinMonitorVolume (AHI_TagBase+130)
251 #define AHIDB_MaxMonitorVolume (AHI_TagBase+131)
252 #define AHIDB_MinInputGain (AHI_TagBase+132)
253 #define AHIDB_MaxInputGain (AHI_TagBase+133)
254 #define AHIDB_MinOutputVolume (AHI_TagBase+134)
255 #define AHIDB_MaxOutputVolume (AHI_TagBase+135)
256 #define AHIDB_Inputs (AHI_TagBase+136)
257 #define AHIDB_InputArg (AHI_TagBase+137) /* ti_Data is input index */
258 #define AHIDB_Input (AHI_TagBase+138)
259 #define AHIDB_Outputs (AHI_TagBase+139)
260 #define AHIDB_OutputArg (AHI_TagBase+140) /* ti_Data is input index */
261 #define AHIDB_Output (AHI_TagBase+141)
262 /* --- New for V4, they will be ignored by V2 and earlier --- */
263 #define AHIDB_Data (AHI_TagBaseR+142) /* Private! */
265 /* AHI_BestAudioIDA tags */
266 /* --- New for V4, they will be ignored by V2 and earlier --- */
267 #define AHIB_Dizzy (AHI_TagBase+190)
269 /* AHI_AudioRequestA tags */
270 /* Window control */
271 #define AHIR_Window (AHI_TagBase+200) /* Parent window */
272 #define AHIR_Screen (AHI_TagBase+201) /* Screen to open on if no window */
273 #define AHIR_PubScreenName (AHI_TagBase+202) /* Name of public screen */
274 #define AHIR_PrivateIDCMP (AHI_TagBase+203) /* Allocate private IDCMP? */
275 #define AHIR_IntuiMsgFunc (AHI_TagBase+204) /* Function to handle IntuiMessages */
276 #define AHIR_SleepWindow (AHI_TagBase+205) /* Block input in AHIR_Window? */
277 #define AHIR_ObsoleteUserData (AHI_TagBase+206) /* V4 UserData */
278 #define AHIR_UserData (AHI_TagBase+207) /* What to put in ahiam_UserData (V5) */
279 /* Text display */
280 #define AHIR_TextAttr (AHI_TagBase+220) /* Text font to use for gadget text */
281 #define AHIR_Locale (AHI_TagBase+221) /* Locale to use for text */
282 #define AHIR_TitleText (AHI_TagBase+222) /* Title of requester */
283 #define AHIR_PositiveText (AHI_TagBase+223) /* Positive gadget text */
284 #define AHIR_NegativeText (AHI_TagBase+224) /* Negative gadget text */
285 /* Initial settings */
286 #define AHIR_InitialLeftEdge (AHI_TagBase+240) /* Initial requester coordinates */
287 #define AHIR_InitialTopEdge (AHI_TagBase+241)
288 #define AHIR_InitialWidth (AHI_TagBase+242) /* Initial requester dimensions */
289 #define AHIR_InitialHeight (AHI_TagBase+243)
290 #define AHIR_InitialAudioID (AHI_TagBase+244) /* Initial audio mode id */
291 #define AHIR_InitialMixFreq (AHI_TagBase+245) /* Initial mixing/sampling frequency */
292 #define AHIR_InitialInfoOpened (AHI_TagBase+246) /* Info window initially opened? */
293 #define AHIR_InitialInfoLeftEdge (AHI_TagBase+247) /* Initial Info window coords. */
294 #define AHIR_InitialInfoTopEdge (AHI_TagBase+248)
295 #define AHIR_InitialInfoWidth (AHI_TagBase+249) /* Not used! */
296 #define AHIR_InitialInfoHeight (AHI_TagBase+250) /* Not used! */
297 /* Options */
298 #define AHIR_DoMixFreq (AHI_TagBase+260) /* Allow selection of mixing frequency? */
299 #define AHIR_DoDefaultMode (AHI_TagBase+261) /* Allow selection of default mode? (V4) */
300 /* Filtering */
301 #define AHIR_FilterTags (AHI_TagBase+270) /* Pointer to filter taglist */
302 #define AHIR_FilterFunc (AHI_TagBase+271) /* Function to filter mode id's */
304 /*** DEFS */
306 #define AHINAME "ahi.device"
307 #define AHI_INVALID_ID (~0UL) /* Invalid Audio ID */
308 #define AHI_DEFAULT_ID (0x00000000UL) /* Only for AHI_AllocAudioA()! */
309 #define AHI_LOOPBACK_ID (0x00000001UL) /* Special sample render Audio ID */
310 #define AHI_DEFAULT_FREQ (0UL) /* Only for AHI_AllocAudioA()! */
311 #define AHI_MIXFREQ (~0UL) /* Special frequency for AHI_SetFreq() */
312 #define AHI_NOSOUND (0xffffU) /* Turns a channel off */
314 /* Set#? Flags */
315 #define AHISF_IMM (1UL<<0) /* Trigger action immediately */
316 #define AHISF_NODELAY (1UL<<1) /* Don't wait for zero-crossing */
318 #define AHISF_NONE (0UL) /* No flags (V5) */
320 #define AHISB_IMM (0UL)
321 #define AHISB_NODELAY (1UL)
323 /* Effect Types */
324 #define AHIET_CANCEL (1UL<<31) /* OR with effect to disable */
325 #define AHIET_MASTERVOLUME (1UL)
326 #define AHIET_OUTPUTBUFFER (2UL)
327 /* --- New for V4 --- */
328 #define AHIET_DSPMASK (3UL)
329 #define AHIET_DSPECHO (4UL)
330 #define AHIET_CHANNELINFO (5UL)
332 /* Sound Types */
333 #define AHIST_NOTYPE (~0UL) /* Private */
334 #define AHIST_SAMPLE (0UL) /* 8 or 16 bit sample */
335 #define AHIST_DYNAMICSAMPLE (1UL) /* Dynamic sample */
336 #define AHIST_INPUT (1UL<<29) /* The input from your sampler */
337 #define AHIST_BW (1UL<<30) /* Private */
339 /* Sample types */
340 /* Note that only AHIST_M8S, AHIST_S8S, AHIST_M16S and AHIST_S16S
341 are supported by AHI_LoadSound(). */
342 #define AHIST_M8S (0UL) /* Mono, 8 bit signed (BYTE) */
343 #define AHIST_M16S (1UL) /* Mono, 16 bit signed (WORD) */
344 #define AHIST_S8S (2UL) /* Stereo, 8 bit signed (2×BYTE) */
345 #define AHIST_S16S (3UL) /* Stereo, 16 bit signed (2×WORD) */
346 #define AHIST_M32S (8UL) /* Mono, 32 bit signed (LONG) */
347 #define AHIST_S32S (10UL) /* Stereo, 32 bit signed (2×LONG) */
349 #define AHIST_M8U (4UL) /* OBSOLETE! */
351 /* Error codes */
352 #define AHIE_OK (0UL) /* No error */
353 #define AHIE_NOMEM (1UL) /* Out of memory */
354 #define AHIE_BADSOUNDTYPE (2UL) /* Unknown sound type */
355 #define AHIE_BADSAMPLETYPE (3UL) /* Unknown/unsupported sample type */
356 #define AHIE_ABORTED (4UL) /* User-triggered abortion */
357 #define AHIE_UNKNOWN (5UL) /* Error, but unknown */
358 #define AHIE_HALFDUPLEX (6UL) /* CMD_WRITE/CMD_READ failure */
362 /* DEVICE INTERFACE DEFINITIONS FOLLOWS ************************************/
364 /* Device units */
366 #define AHI_DEFAULT_UNIT (0U)
367 #define AHI_NO_UNIT (255U)
370 /* The preference file */
372 #define ID_AHIU MAKE_ID('A','H','I','U')
373 #define ID_AHIG MAKE_ID('A','H','I','G')
375 struct AHIUnitPrefs
377 UBYTE ahiup_Unit;
378 UBYTE ahiup_Pad;
379 UWORD ahiup_Channels;
380 ULONG ahiup_AudioMode;
381 ULONG ahiup_Frequency;
382 Fixed ahiup_MonitorVolume;
383 Fixed ahiup_InputGain;
384 Fixed ahiup_OutputVolume;
385 ULONG ahiup_Input;
386 ULONG ahiup_Output;
389 struct AHIGlobalPrefs
391 UWORD ahigp_DebugLevel; /* Range: 0-3 (for None, Low,
392 High and All) */
393 BOOL ahigp_DisableSurround;
394 BOOL ahigp_DisableEcho;
395 BOOL ahigp_FastEcho;
396 Fixed ahigp_MaxCPU;
397 BOOL ahigp_ClipMasterVolume;
398 UWORD ahigp_Pad;
399 Fixed ahigp_AntiClickTime; /* In seconds (V5) */
402 /* Debug levels */
403 #define AHI_DEBUG_NONE (0U)
404 #define AHI_DEBUG_LOW (1U)
405 #define AHI_DEBUG_HIGH (2U)
406 #define AHI_DEBUG_ALL (3U)
408 /* AHIRequest */
410 struct AHIRequest
412 struct IOStdReq ahir_Std; /* Standard IO request */
413 UWORD ahir_Version; /* Needed version */
414 /* --- New for V4, they will be ignored by V2 and earlier --- */
415 UWORD ahir_Pad1;
416 ULONG ahir_Private[2]; /* Hands off! */
417 ULONG ahir_Type; /* Sample format */
418 ULONG ahir_Frequency; /* Sample/Record frequency */
419 Fixed ahir_Volume; /* Sample volume */
420 Fixed ahir_Position; /* Stereo position */
421 struct AHIRequest *ahir_Link; /* For double buffering */
424 /* Flags for OpenDevice() */
426 #define AHIDF_NOMODESCAN (1UL<<0)
427 #define AHIDB_NOMODESCAN (0UL)
429 /****************************************************************************/
431 #ifdef __GNUC__
432 #ifdef __PPC__
433 #pragma pack()
434 #endif
435 #elif defined(__VBCC__)
436 #pragma default-align
437 #endif
440 #ifdef __cplusplus
442 #ifdef __USE_AMIGAOS_NAMESPACE__
444 #endif
445 #endif
447 /****************************************************************************/
449 #endif /* DEVICES_AHI_H */