5 ** $VER: ahi.h 6.1 (17.03.2017)
7 ** ahi.device definitions
9 ** (C) Copyright 1994-2005 Martin Blom
10 ** All Rights Reserved.
15 /*****************************************************************************/
18 #include <exec/types.h>
25 #ifndef UTILITY_TAGITEM_H
26 #include <utility/tagitem.h>
29 #ifndef LIBRARIES_IFFPARSE_H
30 #include <libraries/iffparse.h>
33 /*****************************************************************************/
35 #ifndef EIGHTSVX_H /* Do not define Fixed twice */
37 typedef LONG Fixed
; /* A fixed-point value, 16 bits
38 to the left of the point and
39 16 bits to the right */
41 typedef Fixed sposition
;
49 /* Lots of private data follows! */
53 struct AHISoundMessage
58 /* AHIRecordMessage */
59 struct AHIRecordMessage
61 ULONG ahirm_Type
; /* Format of buffer (object) */
62 APTR ahirm_Buffer
; /* Pointer to the sample array */
63 ULONG ahirm_Length
; /* Number of sample frames in buffer */
69 ULONG ahisi_Type
; /* Format of samples */
70 APTR ahisi_Address
; /* Address to array of samples */
71 ULONG ahisi_Length
; /* Number of samples in array */
75 /* AHIAudioModeRequester */
76 struct AHIAudioModeRequester
78 ULONG ahiam_AudioID
; /* Selected audio mode */
79 ULONG ahiam_MixFreq
; /* Selected mixing/sampling frequency */
81 WORD ahiam_LeftEdge
; /* Coordinates of requester on exit */
86 BOOL ahiam_InfoOpened
; /* Info window opened on exit? */
87 WORD ahiam_InfoLeftEdge
; /* Last coordinates of Info window */
88 WORD ahiam_InfoTopEdge
;
90 WORD ahiam_InfoHeight
;
92 UWORD ahiam_ObsoleteUserData
[2];
94 APTR ahiam_UserData
; /* You can store your own data here (V6) */
95 /* Lots of private data follows! */
98 /* AHIEffMasterVolume */
99 struct AHIEffMasterVolume
101 ULONG ahie_Effect
; /* Set to AHIET_MASTERVOLUME */
102 Fixed ahiemv_Volume
; /* See autodocs for range! */
105 /* AHIEffOutputBuffer */
106 struct AHIEffOutputBuffer
108 ULONG ahie_Effect
; /* Set to AHIET_OUTPUTBUFFER */
109 struct Hook
*ahieob_Func
;
110 /* These fields are filled by AHI */
111 ULONG ahieob_Type
; /* Format of buffer */
112 APTR ahieob_Buffer
; /* Pointer to the sample array */
113 ULONG ahieob_Length
; /* Number of sample frames in buffer */
116 /* AHIEffDSPMask (V4) */
119 ULONG ahie_Effect
; /* Set to AHIET_DSPMASK */
120 UWORD ahiedm_Channels
; /* Number of elements in array */
121 UBYTE ahiedm_Mask
[0]; /* Here follows the array */
124 #define AHIEDM_WET (0)
125 #define AHIEDM_DRY (1)
127 /* AHIEffDSPEcho (V4) */
130 ULONG ahie_Effect
; /* Set to AHIET_DSPECHO */
131 ULONG ahiede_Delay
; /* In samples */
132 Fixed ahiede_Feedback
;
137 #define AHIDSPEcho AHIEffDSPEcho /* Fix for error in V4 includes */
139 /* AHIEffChannelInfo (V4) */
141 struct AHIEffChannelInfo
143 ULONG ahie_Effect
; /* Set to AHIET_CHANNELINFO */
144 struct Hook
*ahieci_Func
;
145 UWORD ahieci_Channels
;
147 /* The rest is filled by AHI */
148 ULONG ahieci_Offset
[0]; /* The array follows */
153 #define AHI_TagBase (TAG_USER)
154 #define AHI_TagBaseR (AHI_TagBase|0x8000)
156 /* AHI_AllocAudioA tags */
157 #define AHIA_AudioID (AHI_TagBase+1) /* Desired audio mode */
158 #define AHIA_MixFreq (AHI_TagBase+2) /* Suggested mixing frequency */
159 #define AHIA_Channels (AHI_TagBase+3) /* Suggested number of channels */
160 #define AHIA_Sounds (AHI_TagBase+4) /* Number of sounds to use */
161 #define AHIA_SoundFunc (AHI_TagBase+5) /* End-of-Sound Hook */
162 #define AHIA_PlayerFunc (AHI_TagBase+6) /* Player Hook */
163 #define AHIA_PlayerFreq (AHI_TagBase+7) /* Frequency for player Hook (Fixed)*/
164 #define AHIA_MinPlayerFreq (AHI_TagBase+8) /* Minimum Frequency for player Hook */
165 #define AHIA_MaxPlayerFreq (AHI_TagBase+9) /* Maximum Frequency for player Hook */
166 #define AHIA_RecordFunc (AHI_TagBase+10) /* Sample recording Hook */
167 #define AHIA_UserData (AHI_TagBase+11) /* What to put in ahiac_UserData */
168 #define AHIA_AntiClickSamples (AHI_TagBase+13) /* # of samples to smooth (V6) */
170 /* AHI_PlayA tags (V4) */
171 #define AHIP_BeginChannel (AHI_TagBase+40) /* All command tags should be... */
172 #define AHIP_EndChannel (AHI_TagBase+41) /* ... enclosed by these tags. */
173 #define AHIP_Freq (AHI_TagBase+50)
174 #define AHIP_Vol (AHI_TagBase+51)
175 #define AHIP_Pan (AHI_TagBase+52)
176 #define AHIP_Sound (AHI_TagBase+53)
177 #define AHIP_Offset (AHI_TagBase+54)
178 #define AHIP_Length (AHI_TagBase+55)
179 #define AHIP_LoopFreq (AHI_TagBase+60)
180 #define AHIP_LoopVol (AHI_TagBase+61)
181 #define AHIP_LoopPan (AHI_TagBase+62)
182 #define AHIP_LoopSound (AHI_TagBase+63)
183 #define AHIP_LoopOffset (AHI_TagBase+64)
184 #define AHIP_LoopLength (AHI_TagBase+65)
186 /* AHI_ControlAudioA tags */
187 #define AHIC_Play (AHI_TagBase+80) /* Boolean */
188 #define AHIC_Record (AHI_TagBase+81) /* Boolean */
189 #define AHIC_MonitorVolume (AHI_TagBase+82)
190 #define AHIC_MonitorVolume_Query (AHI_TagBase+83) /* ti_Data is pointer to Fixed (LONG) */
191 #define AHIC_MixFreq_Query (AHI_TagBase+84) /* ti_Data is pointer to IPTR */
192 /* --- New for V2, they will be ignored by V1 --- */
193 #define AHIC_InputGain (AHI_TagBase+85)
194 #define AHIC_InputGain_Query (AHI_TagBase+86) /* ti_Data is pointer to Fixed (LONG) */
195 #define AHIC_OutputVolume (AHI_TagBase+87)
196 #define AHIC_OutputVolume_Query (AHI_TagBase+88) /* ti_Data is pointer to Fixed (LONG) */
197 #define AHIC_Input (AHI_TagBase+89)
198 #define AHIC_Input_Query (AHI_TagBase+90) /* ti_Data is pointer to IPTR */
199 #define AHIC_Output (AHI_TagBase+91)
200 #define AHIC_Output_Query (AHI_TagBase+92) /* ti_Data is pointer to IPTR */
202 /* AHI_GetAudioAttrsA tags */
203 #define AHIDB_AudioID (AHI_TagBase+100)
204 #define AHIDB_Driver (AHI_TagBaseR+101) /* Pointer to name of driver */
205 #define AHIDB_Flags (AHI_TagBase+102) /* Private! */
206 #define AHIDB_Volume (AHI_TagBase+103) /* Boolean */
207 #define AHIDB_Panning (AHI_TagBase+104) /* Boolean */
208 #define AHIDB_Stereo (AHI_TagBase+105) /* Boolean */
209 #define AHIDB_HiFi (AHI_TagBase+106) /* Boolean */
210 #define AHIDB_PingPong (AHI_TagBase+107) /* Boolean */
211 #define AHIDB_MultTable (AHI_TagBase+108) /* Private! */
212 #define AHIDB_Name (AHI_TagBaseR+109) /* Pointer to name of this mode */
213 #define AHIDB_Bits (AHI_TagBase+110) /* Output bits */
214 #define AHIDB_MaxChannels (AHI_TagBase+111) /* Max supported channels */
215 #define AHIDB_MinMixFreq (AHI_TagBase+112) /* Min mixing freq. supported */
216 #define AHIDB_MaxMixFreq (AHI_TagBase+113) /* Max mixing freq. supported */
217 #define AHIDB_Record (AHI_TagBase+114) /* Boolean */
218 #define AHIDB_Frequencies (AHI_TagBase+115)
219 #define AHIDB_FrequencyArg (AHI_TagBase+116) /* ti_Data is frequency index */
220 #define AHIDB_Frequency (AHI_TagBase+117)
221 #define AHIDB_Author (AHI_TagBase+118) /* Pointer to driver author name */
222 #define AHIDB_Copyright (AHI_TagBase+119) /* Pointer to driver copyright notice */
223 #define AHIDB_Version (AHI_TagBase+120) /* Pointer to driver version string */
224 #define AHIDB_Annotation (AHI_TagBase+121) /* Pointer to driver annotation text */
225 #define AHIDB_BufferLen (AHI_TagBase+122) /* Specifies the string buffer size */
226 #define AHIDB_IndexArg (AHI_TagBase+123) /* ti_Data is frequency! */
227 #define AHIDB_Index (AHI_TagBase+124)
228 #define AHIDB_Realtime (AHI_TagBase+125) /* Boolean */
229 #define AHIDB_MaxPlaySamples (AHI_TagBase+126) /* It's sample *frames* */
230 #define AHIDB_MaxRecordSamples (AHI_TagBase+127) /* It's sample *frames* */
231 #define AHIDB_FullDuplex (AHI_TagBase+129) /* Boolean */
232 /* --- New for V2, they will be ignored by V1 --- */
233 #define AHIDB_MinMonitorVolume (AHI_TagBase+130)
234 #define AHIDB_MaxMonitorVolume (AHI_TagBase+131)
235 #define AHIDB_MinInputGain (AHI_TagBase+132)
236 #define AHIDB_MaxInputGain (AHI_TagBase+133)
237 #define AHIDB_MinOutputVolume (AHI_TagBase+134)
238 #define AHIDB_MaxOutputVolume (AHI_TagBase+135)
239 #define AHIDB_Inputs (AHI_TagBase+136)
240 #define AHIDB_InputArg (AHI_TagBase+137) /* ti_Data is input index */
241 #define AHIDB_Input (AHI_TagBase+138)
242 #define AHIDB_Outputs (AHI_TagBase+139)
243 #define AHIDB_OutputArg (AHI_TagBase+140) /* ti_Data is input index */
244 #define AHIDB_Output (AHI_TagBase+141)
245 /* --- New for V4, they will be ignored by V2 and earlier --- */
246 #define AHIDB_Data (AHI_TagBaseR+142) /* Private! */
247 #define AHIDB_DriverBaseName (AHI_TagBaseR+143) /* Private! */
248 /* --- New for V6, they will be ignored by V4 and earlier --- */
249 #define AHIDB_MultiChannel (AHI_TagBase+144) /* Boolean */
251 /* AHI_BestAudioIDA tags */
252 /* --- New for V4, they will be ignored by V2 and earlier --- */
253 #define AHIB_Dizzy (AHI_TagBase+190)
255 /* AHI_AudioRequestA tags */
257 #define AHIR_Window (AHI_TagBase+200) /* Parent window */
258 #define AHIR_Screen (AHI_TagBase+201) /* Screen to open on if no window */
259 #define AHIR_PubScreenName (AHI_TagBase+202) /* Name of public screen */
260 #define AHIR_PrivateIDCMP (AHI_TagBase+203) /* Allocate private IDCMP? */
261 #define AHIR_IntuiMsgFunc (AHI_TagBase+204) /* Function to handle IntuiMessages */
262 #define AHIR_SleepWindow (AHI_TagBase+205) /* Block input in AHIR_Window? */
263 #define AHIR_ObsoleteUserData (AHI_TagBase+206) /* V4 UserData */
264 #define AHIR_UserData (AHI_TagBase+207) /* What to put in ahiam_UserData (V6) */
266 #define AHIR_TextAttr (AHI_TagBase+220) /* Text font to use for gadget text */
267 #define AHIR_Locale (AHI_TagBase+221) /* Locale to use for text */
268 #define AHIR_TitleText (AHI_TagBase+222) /* Title of requester */
269 #define AHIR_PositiveText (AHI_TagBase+223) /* Positive gadget text */
270 #define AHIR_NegativeText (AHI_TagBase+224) /* Negative gadget text */
271 /* Initial settings */
272 #define AHIR_InitialLeftEdge (AHI_TagBase+240) /* Initial requester coordinates */
273 #define AHIR_InitialTopEdge (AHI_TagBase+241)
274 #define AHIR_InitialWidth (AHI_TagBase+242) /* Initial requester dimensions */
275 #define AHIR_InitialHeight (AHI_TagBase+243)
276 #define AHIR_InitialAudioID (AHI_TagBase+244) /* Initial audio mode id */
277 #define AHIR_InitialMixFreq (AHI_TagBase+245) /* Initial mixing/sampling frequency */
278 #define AHIR_InitialInfoOpened (AHI_TagBase+246) /* Info window initially opened? */
279 #define AHIR_InitialInfoLeftEdge (AHI_TagBase+247) /* Initial Info window coords. */
280 #define AHIR_InitialInfoTopEdge (AHI_TagBase+248)
281 #define AHIR_InitialInfoWidth (AHI_TagBase+249) /* Not used! */
282 #define AHIR_InitialInfoHeight (AHI_TagBase+250) /* Not used! */
284 #define AHIR_DoMixFreq (AHI_TagBase+260) /* Allow selection of mixing frequency? */
285 #define AHIR_DoDefaultMode (AHI_TagBase+261) /* Allow selection of default mode? (V4) */
287 #define AHIR_FilterTags (AHI_TagBase+270) /* Pointer to filter taglist */
288 #define AHIR_FilterFunc (AHI_TagBase+271) /* Function to filter mode id's */
292 #define AHINAME "ahi.device"
293 #define AHI_INVALID_ID (~0U) /* Invalid Audio ID */
294 #define AHI_DEFAULT_ID (0x00000000U) /* Only for AHI_AllocAudioA()! */
295 #define AHI_LOOPBACK_ID (0x00000001U) /* Special sample render Audio ID */
296 #define AHI_DEFAULT_FREQ (0U) /* Only for AHI_AllocAudioA()! */
297 #define AHI_MIXFREQ (~0U) /* Special frequency for AHI_SetFreq() */
298 #define AHI_NOSOUND (0xffffU) /* Turns a channel off */
301 #define AHISF_IMM (1U<<0) /* Trigger action immediately */
302 #define AHISF_NODELAY (1U<<1) /* Don't wait for zero-crossing */
304 #define AHISF_NONE (0U) /* No flags (V6) */
306 #define AHISB_IMM (0U)
307 #define AHISB_NODELAY (1U)
310 #define AHIET_CANCEL (1U<<31) /* OR with effect to disable */
311 #define AHIET_MASTERVOLUME (1U)
312 #define AHIET_OUTPUTBUFFER (2U)
313 /* --- New for V4 --- */
314 #define AHIET_DSPMASK (3U)
315 #define AHIET_DSPECHO (4U)
316 #define AHIET_CHANNELINFO (5U)
319 #define AHIST_NOTYPE (~0U) /* Private */
320 #define AHIST_SAMPLE (0U) /* 8 or 16 bit sample */
321 #define AHIST_DYNAMICSAMPLE (1U) /* Dynamic sample */
322 #define AHIST_INPUT (1U<<29) /* The input from your sampler */
323 #define AHIST_BW (1U<<30) /* Private */
326 /* Note that only AHIST_M8S, AHIST_S8S, AHIST_M16S and AHIST_S16S
327 (plus AHIST_M32S, AHIST_S32S and AHIST_L7_1 in V6)
328 are supported by AHI_LoadSound(). */
329 #define AHIST_M8S (0U) /* Mono, 8 bit signed (BYTE) */
330 #define AHIST_M16S (1U) /* Mono, 16 bit signed (WORD) */
331 #define AHIST_S8S (2U) /* Stereo, 8 bit signed (2×BYTE) */
332 #define AHIST_S16S (3U) /* Stereo, 16 bit signed (2×WORD) */
333 #define AHIST_M32S (8U) /* Mono, 32 bit signed (LONG) */
334 #define AHIST_S32S (10U) /* Stereo, 32 bit signed (2×LONG) */
336 #define AHIST_M8U (4U) /* OBSOLETE! */
337 #define AHIST_L7_1 (0x00c3000aU) /* 7.1, 32 bit signed (8×LONG) */
340 #define AHIE_OK (0U) /* No error */
341 #define AHIE_NOMEM (1U) /* Out of memory */
342 #define AHIE_BADSOUNDTYPE (2U) /* Unknown sound type */
343 #define AHIE_BADSAMPLETYPE (3U) /* Unknown/unsupported sample type */
344 #define AHIE_ABORTED (4U) /* User-triggered abortion */
345 #define AHIE_UNKNOWN (5U) /* Error, but unknown */
346 #define AHIE_HALFDUPLEX (6U) /* CMD_WRITE/CMD_READ failure */
350 /* DEVICE INTERFACE DEFINITIONS FOLLOWS ************************************/
354 #define AHI_DEFAULT_UNIT (0U)
355 #define AHI_NO_UNIT (255U)
358 /* The preference file */
360 #define ID_AHIU MAKE_ID('A','H','I','U')
361 #define ID_AHIG MAKE_ID('A','H','I','G')
366 UBYTE ahiup_Obsolete
; /* Was ahiup_ScaleMode */
367 UWORD ahiup_Channels
;
368 ULONG ahiup_AudioMode
;
369 ULONG ahiup_Frequency
;
370 Fixed ahiup_MonitorVolume
;
371 Fixed ahiup_InputGain
;
372 Fixed ahiup_OutputVolume
;
377 struct AHIGlobalPrefs
379 UWORD ahigp_DebugLevel
; /* Range: 0-3 (for None, Low,
381 BOOL ahigp_DisableSurround
;
382 BOOL ahigp_DisableEcho
;
385 BOOL ahigp_ClipMasterVolume
;
387 Fixed ahigp_AntiClickTime
; /* In seconds (V6) */
388 UWORD ahigp_ScaleMode
; /* See below (V6) */
392 #define AHI_DEBUG_NONE (0U)
393 #define AHI_DEBUG_LOW (1U)
394 #define AHI_DEBUG_HIGH (2U)
395 #define AHI_DEBUG_ALL (3U)
398 #define AHI_SCALE_FIXED_SAFE (0U) /* x=y*1/max(ch) */
399 #define AHI_SCALE_DYNAMIC_SAFE (1U) /* x=y*1/ch */
400 #define AHI_SCALE_FIXED_0_DB (2U) /* x=y */
401 #define AHI_SCALE_FIXED_3_DB (3U) /* x=y*1/sqrt(2) */
402 #define AHI_SCALE_FIXED_6_DB (4U) /* x=y*1/2 */
408 struct IOStdReq ahir_Std
; /* Standard IO request */
409 UWORD ahir_Version
; /* Needed version */
410 /* --- New for V4, they will be ignored by V2 and earlier --- */
412 IPTR ahir_Private
[2]; /* Hands off! */
413 ULONG ahir_Type
; /* Sample format */
414 ULONG ahir_Frequency
; /* Sample/Record frequency */
415 Fixed ahir_Volume
; /* Sample volume */
416 Fixed ahir_Position
; /* Stereo position */
417 struct AHIRequest
*ahir_Link
; /* For double buffering */
420 /* Flags for OpenDevice() */
422 #define AHIDF_NOMODESCAN (1U<<0)
423 #define AHIDB_NOMODESCAN (0U)
425 #endif /* DEVICES_AHI_H */