2
This file is part of the Free Pascal run time library.
4
A file in Amiga system run time library.
5
Copyright (c) 2003 by Nils Sj�holm.
6
member of the Amiga RTL development team.
8
This is a unit for ahi.library
10
See the file COPYING.FPC, included in this distribution,
11
for details about the copyright.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
**********************************************************************}
21
First version of this unit.
24
Changed cardinal > longword.
25
Added startcode for unit.
28
nils.sjoholm@mailbox.swipnet.se Nils Sjoholm
32
{$I useamigasmartlink.inc}
33
{$ifdef use_amiga_smartlink}
35
{$endif use_amiga_smartlink}
43
VAR AHIBase : pLibrary;
46
$VER: ahi.h 4.2 (27.4.97)
48
ahi.device definitions
50
(C) Copyright 1994-1997 Martin Blom
60
{ A fixed-point value, 16 bits
61
to the left of the point and
62
16 bits to the right }
66
Psposition = ^sposition;
70
{ Lots of private data follows! }
71
PAHIAudioCtrl = ^tAHIAudioCtrl;
72
tAHIAudioCtrl = record
73
ahiac_UserData : APTR;
77
PAHISoundMessage = ^tAHISoundMessage;
78
tAHISoundMessage = record
79
ahism_Channel : UWORD;
83
PAHIRecordMessage = ^tAHIRecordMessage;
84
tAHIRecordMessage = record
85
ahirm_Type : ULONG; { Format of buffer (object) }
86
ahirm_Buffer : APTR; { Pointer to the sample array }
87
ahirm_Length : ULONG; { Number of sample frames in buffer }
91
PAHISampleInfo = ^tAHISampleInfo;
92
tAHISampleInfo = record
93
ahisi_Type : ULONG; { Format of samples }
94
ahisi_Address : APTR; { Address to array of samples }
95
ahisi_Length : ULONG; { Number of samples in array }
98
{ AHIAudioModeRequester }
99
PAHIAudioModeRequester = ^tAHIAudioModeRequester;
100
tAHIAudioModeRequester = record
101
ahiam_AudioID : ULONG; { Selected audio mode }
102
ahiam_MixFreq : ULONG; { Selected mixing/sampling frequency }
103
ahiam_LeftEdge : WORD; { Coordinates of requester on exit }
104
ahiam_TopEdge : WORD;
107
ahiam_InfoOpened : BOOL; { Info window opened on exit? }
108
ahiam_InfoLeftEdge : WORD; { Last coordinates of Info window }
109
ahiam_InfoTopEdge : WORD;
110
ahiam_InfoWidth : WORD;
111
ahiam_InfoHeight : WORD;
112
ahiam_UserData : APTR; { You can store your own data here }
113
{ Lots of private data follows! }
116
{ AHIEffMasterVolume }
117
PAHIEffMasterVolume = ^tAHIEffMasterVolume;
118
tAHIEffMasterVolume = record
119
ahie_Effect : ULONG; { Set to AHIET_MASTERVOLUME }
120
ahiemv_Volume : Fixed; { See autodocs for range! }
123
{ AHIEffOutputBuffer }
124
PAHIEffOutputBuffer = ^tAHIEffOutputBuffer;
125
tAHIEffOutputBuffer = record
126
ahie_Effect : ULONG; { Set to AHIET_OUTPUTBUFFER }
128
{ These fields are filled by AHI }
129
ahieob_Type : ULONG; { Format of buffer }
130
ahieob_Buffer : APTR; { Pointer to the sample array }
131
ahieob_Length : ULONG; { Number of sample frames in buffer }
134
{ AHIEffDSPMask (V4) }
135
PAHIEffDSPMask = ^tAHIEffDSPMask;
136
tAHIEffDSPMask = record
137
ahie_Effect : ULONG; { Set to AHIET_DSPMASK }
138
ahiedm_Channels : UWORD; { Number of elements in array }
139
ahiedm_Mask : array[0..0] of UBYTE; { Here follows the array }
146
{ AHIEffDSPEcho (V4) }
148
PAHIDSPEcho = ^tAHIDSPEcho;
150
ahie_Effect : ULONG; { Set to AHIET_DSPECHO }
151
ahiede_Delay : ULONG; { In samples }
152
ahiede_Feedback : Fixed;
154
ahiede_Cross : Fixed;
157
{ AHIEffChannelInfo (V4) }
158
PAHIEffChannelInfo = ^tAHIEffChannelInfo;
159
tAHIEffChannelInfo = record
160
ahie_Effect : ULONG; { Set to AHIET_CHANNELINFO }
162
ahieci_Channels : UWORD;
164
{ The rest is filled by AHI }
165
ahieci_Offset : array[0..0] of ULONG; { The array follows }
171
AHI_TagBase = TAG_USER;
172
AHI_TagBaseR = AHI_TagBase or $8000;
173
{ AHI_AllocAudioA tags }
174
{ Desired audio mode }
175
AHIA_AudioID = AHI_TagBase + 1;
176
{ Suggested mixing frequency }
177
AHIA_MixFreq = AHI_TagBase + 2;
178
{ Suggested number of channels }
179
AHIA_Channels = AHI_TagBase + 3;
180
{ Number of sounds to use }
181
AHIA_Sounds = AHI_TagBase + 4;
182
{ End-of-Sound Hook }
183
AHIA_SoundFunc = AHI_TagBase + 5;
185
AHIA_PlayerFunc = AHI_TagBase + 6;
186
{ Frequency for player Hook (Fixed) }
187
AHIA_PlayerFreq = AHI_TagBase + 7;
188
{ Minimum Frequency for player Hook }
189
AHIA_MinPlayerFreq = AHI_TagBase + 8;
190
{ Maximum Frequency for player Hook }
191
AHIA_MaxPlayerFreq = AHI_TagBase + 9;
192
{ Sample recording Hook }
193
AHIA_RecordFunc = AHI_TagBase + 10;
194
{ What to put in ahiac_UserData }
195
AHIA_UserData = AHI_TagBase + 11;
196
{ AHI_PlayA tags (V4) }
197
{ All command tags should be... }
198
AHIP_BeginChannel = AHI_TagBase + 40;
199
{ ... enclosed by these tags. }
200
AHIP_EndChannel = AHI_TagBase + 41;
201
AHIP_Freq = AHI_TagBase + 50;
202
AHIP_Vol = AHI_TagBase + 51;
203
AHIP_Pan = AHI_TagBase + 52;
204
AHIP_Sound = AHI_TagBase + 53;
205
AHIP_Offset = AHI_TagBase + 54;
206
AHIP_Length = AHI_TagBase + 55;
207
AHIP_LoopFreq = AHI_TagBase + 60;
208
AHIP_LoopVol = AHI_TagBase + 61;
209
AHIP_LoopPan = AHI_TagBase + 62;
210
AHIP_LoopSound = AHI_TagBase + 63;
211
AHIP_LoopOffset = AHI_TagBase + 64;
212
AHIP_LoopLength = AHI_TagBase + 65;
213
{ AHI_ControlAudioA tags }
215
AHIC_Play = AHI_TagBase + 80;
217
AHIC_Record = AHI_TagBase + 81;
218
AHIC_MonitorVolume = AHI_TagBase + 82;
219
{ ti_Data is pointer to Fixed (LONG) }
220
AHIC_MonitorVolume_Query = AHI_TagBase + 83;
221
{ ti_Data is pointer to ULONG }
222
AHIC_MixFreq_Query = AHI_TagBase + 84;
223
{ --- New for V2, they will be ignored by V1 --- }
224
AHIC_InputGain = AHI_TagBase + 85;
225
{ ti_Data is pointer to Fixed (LONG) }
226
AHIC_InputGain_Query = AHI_TagBase + 86;
227
AHIC_OutputVolume = AHI_TagBase + 87;
228
{ ti_Data is pointer to Fixed (LONG) }
229
AHIC_OutputVolume_Query = AHI_TagBase + 88;
230
AHIC_Input = AHI_TagBase + 89;
231
{ ti_Data is pointer to ULONG }
232
AHIC_Input_Query = AHI_TagBase + 90;
233
AHIC_Output = AHI_TagBase + 91;
234
{ ti_Data is pointer to ULONG }
235
AHIC_Output_Query = AHI_TagBase + 92;
236
{ AHI_GetAudioAttrsA tags }
237
AHIDB_AudioID = AHI_TagBase + 100;
238
{ Pointer to name of driver }
239
AHIDB_Driver = AHI_TagBaseR + 101;
241
AHIDB_Flags = AHI_TagBase + 102;
243
AHIDB_Volume = AHI_TagBase + 103;
245
AHIDB_Panning = AHI_TagBase + 104;
247
AHIDB_Stereo = AHI_TagBase + 105;
249
AHIDB_HiFi = AHI_TagBase + 106;
251
AHIDB_PingPong = AHI_TagBase + 107;
253
AHIDB_MultTable = AHI_TagBase + 108;
254
{ Pointer to name of this mode }
255
AHIDB_Name = AHI_TagBaseR + 109;
257
AHIDB_Bits = AHI_TagBase + 110;
258
{ Max supported channels }
259
AHIDB_MaxChannels = AHI_TagBase + 111;
260
{ Min mixing freq. supported }
261
AHIDB_MinMixFreq = AHI_TagBase + 112;
262
{ Max mixing freq. supported }
263
AHIDB_MaxMixFreq = AHI_TagBase + 113;
265
AHIDB_Record = AHI_TagBase + 114;
266
AHIDB_Frequencies = AHI_TagBase + 115;
267
{ ti_Data is frequency index }
268
AHIDB_FrequencyArg = AHI_TagBase + 116;
269
AHIDB_Frequency = AHI_TagBase + 117;
270
{ Pointer to driver author name }
271
AHIDB_Author = AHI_TagBase + 118;
272
{ Pointer to driver copyright notice }
273
AHIDB_Copyright = AHI_TagBase + 119;
274
{ Pointer to driver version string }
275
AHIDB_Version = AHI_TagBase + 120;
276
{ Pointer to driver annotation text }
277
AHIDB_Annotation = AHI_TagBase + 121;
278
{ Specifies the string buffer size }
279
AHIDB_BufferLen = AHI_TagBase + 122;
280
{ ti_Data is frequency! }
281
AHIDB_IndexArg = AHI_TagBase + 123;
282
AHIDB_Index = AHI_TagBase + 124;
284
AHIDB_Realtime = AHI_TagBase + 125;
285
{ It's sample frames }
286
AHIDB_MaxPlaySamples = AHI_TagBase + 126;
287
{ It's sample frames }
288
AHIDB_MaxRecordSamples = AHI_TagBase + 127;
290
AHIDB_FullDuplex = AHI_TagBase + 129;
291
{ --- New for V2, they will be ignored by V1 --- }
292
AHIDB_MinMonitorVolume = AHI_TagBase + 130;
293
AHIDB_MaxMonitorVolume = AHI_TagBase + 131;
294
AHIDB_MinInputGain = AHI_TagBase + 132;
295
AHIDB_MaxInputGain = AHI_TagBase + 133;
296
AHIDB_MinOutputVolume = AHI_TagBase + 134;
297
AHIDB_MaxOutputVolume = AHI_TagBase + 135;
298
AHIDB_Inputs = AHI_TagBase + 136;
299
{ ti_Data is input index }
300
AHIDB_InputArg = AHI_TagBase + 137;
301
AHIDB_Input = AHI_TagBase + 138;
302
AHIDB_Outputs = AHI_TagBase + 139;
303
{ ti_Data is input index }
304
AHIDB_OutputArg = AHI_TagBase + 140;
305
AHIDB_Output = AHI_TagBase + 141;
306
{ --- New for V4, they will be ignored by V2 and earlier --- }
308
AHIDB_Data = AHI_TagBaseR + 142;
309
{ AHI_BestAudioIDA tags }
310
{ --- New for V4, they will be ignored by V2 and earlier --- }
311
AHIB_Dizzy = AHI_TagBase + 190;
312
{ AHI_AudioRequestA tags }
315
AHIR_Window = AHI_TagBase + 200;
316
{ Screen to open on if no window }
317
AHIR_Screen = AHI_TagBase + 201;
318
{ Name of public screen }
319
AHIR_PubScreenName = AHI_TagBase + 202;
320
{ Allocate private IDCMP? }
321
AHIR_PrivateIDCMP = AHI_TagBase + 203;
322
{ Function to handle IntuiMessages }
323
AHIR_IntuiMsgFunc = AHI_TagBase + 204;
324
{ Block input in AHIR_Window? }
325
AHIR_SleepWindow = AHI_TagBase + 205;
326
{ What to put in ahiam_UserData }
327
AHIR_UserData = AHI_TagBase + 206;
329
{ Text font to use for gadget text }
330
AHIR_TextAttr = AHI_TagBase + 220;
331
{ Locale to use for text }
332
AHIR_Locale = AHI_TagBase + 221;
333
{ Title of requester }
334
AHIR_TitleText = AHI_TagBase + 222;
335
{ Positive gadget text }
336
AHIR_PositiveText = AHI_TagBase + 223;
337
{ Negative gadget text }
338
AHIR_NegativeText = AHI_TagBase + 224;
340
{ Initial requester coordinates }
341
AHIR_InitialLeftEdge = AHI_TagBase + 240;
342
AHIR_InitialTopEdge = AHI_TagBase + 241;
343
{ Initial requester dimensions }
344
AHIR_InitialWidth = AHI_TagBase + 242;
345
AHIR_InitialHeight = AHI_TagBase + 243;
346
{ Initial audio mode id }
347
AHIR_InitialAudioID = AHI_TagBase + 244;
348
{ Initial mixing/sampling frequency }
349
AHIR_InitialMixFreq = AHI_TagBase + 245;
350
{ Info window initially opened? }
351
AHIR_InitialInfoOpened = AHI_TagBase + 246;
352
{ Initial Info window coords. }
353
AHIR_InitialInfoLeftEdge = AHI_TagBase + 247;
354
AHIR_InitialInfoTopEdge = AHI_TagBase + 248;
356
AHIR_InitialInfoWidth = AHI_TagBase + 249;
358
AHIR_InitialInfoHeight = AHI_TagBase + 250;
360
{ Allow selection of mixing frequency? }
361
AHIR_DoMixFreq = AHI_TagBase + 260;
362
{ Allow selection of default mode? (V4) }
363
AHIR_DoDefaultMode = AHI_TagBase + 261;
365
{ Pointer to filter taglist }
366
AHIR_FilterTags = AHI_TagBase + 270;
367
{ Function to filter mode id's }
368
AHIR_FilterFunc = AHI_TagBase + 271;
370
AHINAME : PChar = 'ahi.device';
372
AHI_INVALID_ID = not (0);
373
{ Only for AHI_AllocAudioA()! }
374
AHI_DEFAULT_ID = $00000000;
375
{ Special sample render Audio ID }
376
AHI_LOOPBACK_ID = $00000001;
377
{ Only for AHI_AllocAudioA()! }
378
AHI_DEFAULT_FREQ = 0;
379
{ Special frequency for AHI_SetFreq() }
380
AHI_MIXFREQ = not (0);
381
{ Turns a channel off }
387
{ OR with effect to disable }
388
AHIET_CANCEL = 1 shl 31;
389
AHIET_MASTERVOLUME = 1;
390
AHIET_OUTPUTBUFFER = 2;
391
{ --- New for V4 --- }
394
AHIET_CHANNELINFO = 5;
397
AHIST_NOTYPE = not (0);
398
{ 8 or 16 bit sample }
401
AHIST_DYNAMICSAMPLE = 1;
402
{ The input from your sampler }
403
AHIST_INPUT = 1 shl 29;
407
{ Note that only AHIST_M8S, AHIST_S8S, AHIST_M16S and AHIST_S16S
408
are supported by AHI_LoadSound(). }
409
{ Mono, 8 bit signed (BYTE) }
411
{ Mono, 16 bit signed (WORD) }
413
{ Stereo, 8 bit signed (2�BYTE) }
415
{ Stereo, 16 bit signed (2�WORD) }
417
{ Mono, 32 bit signed (LONG) }
419
{ Stereo, 32 bit signed (2�LONG) }
428
{ Unknown sound type }
429
AHIE_BADSOUNDTYPE = 2;
430
{ Unknown/unsupported sample type }
431
AHIE_BADSAMPLETYPE = 3;
432
{ User-triggered abortion }
434
{ Error, but unknown }
436
{ CMD_WRITE/CMD_READ failure }
438
{ DEVICE INTERFACE DEFINITIONS FOLLOWS }
440
AHI_DEFAULT_UNIT = 0;
442
{ The preference file }
448
PAHIUnitPrefs = ^tAHIUnitPrefs;
449
tAHIUnitPrefs = record
452
ahiup_Channels : UWORD;
453
ahiup_AudioMode : ULONG;
454
ahiup_Frequency : ULONG;
455
ahiup_MonitorVolume : Fixed;
456
ahiup_InputGain : Fixed;
457
ahiup_OutputVolume : Fixed;
459
ahiup_Output : ULONG;
464
PAHIGlobalPrefs = ^tAHIGlobalPrefs;
465
tAHIGlobalPrefs = record
466
ahigp_DebugLevel : UWORD; { Range: 0-3 (for None, Low,}
467
ahigp_DisableSurround : BOOL; { High and All) }
468
ahigp_DisableEcho : BOOL;
469
ahigp_FastEcho : BOOL;
470
ahigp_MaxCPU : Fixed;
471
ahigp_ClipMasterVolume : BOOL;
484
PAHIRequest = ^tAHIRequest;
486
ahir_Std : tIOStdReq; { Standard IO request }
487
ahir_Version : UWORD; { Needed version }
488
{ --- New for V4, they will be ignored by V2 and earlier --- }
490
ahir_Private : array[0..1] of ULONG; { Hands off! }
491
ahir_Type : ULONG; { Sample format }
492
ahir_Frequency : ULONG; { Sample/Record frequency }
493
ahir_Volume : Fixed; { Sample volume }
494
ahir_Position : Fixed; { Stereo position }
495
ahir_Link : PAHIRequest; { For double buffering }
498
{ Flags for OpenDevice() }
501
AHIDF_NOMODESCAN = 1 shl 0;
502
AHIDB_NOMODESCAN = 0;
506
FUNCTION AHI_AddAudioMode(a0arg : pTagItem) : longword;
507
FUNCTION AHI_AllocAudioA(tagList : pTagItem) : pAHIAudioCtrl;
508
FUNCTION AHI_AllocAudioRequestA(tagList : pTagItem) : pAHIAudioModeRequester;
509
FUNCTION AHI_AudioRequestA(Requester : pAHIAudioModeRequester; tagList : pTagItem) : BOOLEAN;
510
FUNCTION AHI_BestAudioIDA(tagList : pTagItem) : longword;
511
FUNCTION AHI_ControlAudioA(AudioCtrl : pAHIAudioCtrl; tagList : pTagItem) : longword;
512
PROCEDURE AHI_FreeAudio(AudioCtrl : pAHIAudioCtrl);
513
PROCEDURE AHI_FreeAudioRequest(Requester : pAHIAudioModeRequester);
514
FUNCTION AHI_GetAudioAttrsA(ID : longword; Audioctrl : pAHIAudioCtrl; tagList : pTagItem) : BOOLEAN;
515
PROCEDURE AHI_KillAudio;
516
FUNCTION AHI_LoadModeFile(a0arg : pCHAR) : longword;
517
FUNCTION AHI_LoadSound(Sound : WORD; _Type : longword; Info : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
518
FUNCTION AHI_NextAudioID(Last_ID : longword) : longword;
519
PROCEDURE AHI_PlayA(Audioctrl : pAHIAudioCtrl; tagList : pTagItem);
520
FUNCTION AHI_RemoveAudioMode(d0arg : longword) : longword;
521
FUNCTION AHI_SampleFrameSize(SampleType : longword) : longword;
522
FUNCTION AHI_SetEffect(Effect : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
523
PROCEDURE AHI_SetFreq(Channel : WORD; Freq : longword; AudioCtrl : pAHIAudioCtrl; Flags : longword);
524
PROCEDURE AHI_SetSound(Channel : WORD; Sound : WORD; Offset : longword; len : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
525
PROCEDURE AHI_SetVol(Channel : WORD; Volume : LONGINT; Pan : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
526
PROCEDURE AHI_UnloadSound(Sound : WORD; Audioctrl : pAHIAudioCtrl);
528
Functions and procedures with array of const go here
530
FUNCTION AHI_AllocAudio(const tagList : Array Of Const) : pAHIAudioCtrl;
531
FUNCTION AHI_AllocAudioRequest(const tagList : Array Of Const) : pAHIAudioModeRequester;
532
FUNCTION AHI_AudioRequest(Requester : pAHIAudioModeRequester; const tagList : Array Of Const) : BOOLEAN;
533
FUNCTION AHI_BestAudioID(const tagList : Array Of Const) : longword;
534
FUNCTION AHI_ControlAudio(AudioCtrl : pAHIAudioCtrl; const tagList : Array Of Const) : longword;
535
FUNCTION AHI_GetAudioAttrs(ID : longword; Audioctrl : pAHIAudioCtrl; const tagList : Array Of Const) : BOOLEAN;
536
PROCEDURE AHI_Play(Audioctrl : pAHIAudioCtrl; const tagList : Array Of Const);
538
{You can remove this include and use a define instead}
539
{$I useautoopenlib.inc}
540
{$ifdef use_init_openlib}
541
procedure InitAHILibrary;
542
{$endif use_init_openlib}
544
{This is a variable that knows how the unit is compiled}
546
AHIIsCompiledHow : longint;
550
{$ifndef dont_use_openlib}
552
{$endif dont_use_openlib}
555
FUNCTION AHI_AddAudioMode(a0arg : pTagItem) : longword;
567
FUNCTION AHI_AllocAudioA(tagList : pTagItem) : pAHIAudioCtrl;
579
FUNCTION AHI_AllocAudioRequestA(tagList : pTagItem) : pAHIAudioModeRequester;
591
FUNCTION AHI_AudioRequestA(Requester : pAHIAudioModeRequester; tagList : pTagItem) : BOOLEAN;
603
@end: MOVE.B D0,@RESULT
607
FUNCTION AHI_BestAudioIDA(tagList : pTagItem) : longword;
619
FUNCTION AHI_ControlAudioA(AudioCtrl : pAHIAudioCtrl; tagList : pTagItem) : longword;
632
PROCEDURE AHI_FreeAudio(AudioCtrl : pAHIAudioCtrl);
643
PROCEDURE AHI_FreeAudioRequest(Requester : pAHIAudioModeRequester);
654
FUNCTION AHI_GetAudioAttrsA(ID : longword; Audioctrl : pAHIAudioCtrl; tagList : pTagItem) : BOOLEAN;
667
@end: MOVE.B D0,@RESULT
671
PROCEDURE AHI_KillAudio;
681
FUNCTION AHI_LoadModeFile(a0arg : pCHAR) : longword;
693
FUNCTION AHI_LoadSound(Sound : WORD; _Type : longword; Info : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
708
FUNCTION AHI_NextAudioID(Last_ID : longword) : longword;
720
PROCEDURE AHI_PlayA(Audioctrl : pAHIAudioCtrl; tagList : pTagItem);
732
FUNCTION AHI_RemoveAudioMode(d0arg : longword) : longword;
744
FUNCTION AHI_SampleFrameSize(SampleType : longword) : longword;
756
FUNCTION AHI_SetEffect(Effect : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
769
PROCEDURE AHI_SetFreq(Channel : WORD; Freq : longword; AudioCtrl : pAHIAudioCtrl; Flags : longword);
783
PROCEDURE AHI_SetSound(Channel : WORD; Sound : WORD; Offset : longword; len : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
799
PROCEDURE AHI_SetVol(Channel : WORD; Volume : LONGINT; Pan : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
814
PROCEDURE AHI_UnloadSound(Sound : WORD; Audioctrl : pAHIAudioCtrl);
827
Functions and procedures with array of const go here
829
FUNCTION AHI_AllocAudio(const tagList : Array Of Const) : pAHIAudioCtrl;
831
AHI_AllocAudio := AHI_AllocAudioA(readintags(tagList));
834
FUNCTION AHI_AllocAudioRequest(const tagList : Array Of Const) : pAHIAudioModeRequester;
836
AHI_AllocAudioRequest := AHI_AllocAudioRequestA(readintags(tagList));
839
FUNCTION AHI_AudioRequest(Requester : pAHIAudioModeRequester; const tagList : Array Of Const) : BOOLEAN;
841
AHI_AudioRequest := AHI_AudioRequestA(Requester , readintags(tagList));
844
FUNCTION AHI_BestAudioID(const tagList : Array Of Const) : longword;
846
AHI_BestAudioID := AHI_BestAudioIDA(readintags(tagList));
849
FUNCTION AHI_ControlAudio(AudioCtrl : pAHIAudioCtrl; const tagList : Array Of Const) : longword;
851
AHI_ControlAudio := AHI_ControlAudioA(AudioCtrl , readintags(tagList));
854
FUNCTION AHI_GetAudioAttrs(ID : longword; Audioctrl : pAHIAudioCtrl; const tagList : Array Of Const) : BOOLEAN;
856
AHI_GetAudioAttrs := AHI_GetAudioAttrsA(ID , Audioctrl , readintags(tagList));
859
PROCEDURE AHI_Play(Audioctrl : pAHIAudioCtrl; const tagList : Array Of Const);
861
AHI_PlayA(Audioctrl , readintags(tagList));
865
{ Change VERSION and LIBVERSION to proper values }
867
VERSION : string[2] = '0';
868
LIBVERSION : longword = 0;
870
{$ifdef use_init_openlib}
871
{$Info Compiling initopening of ahi.library}
872
{$Info don't forget to use InitAHILibrary in the beginning of your program}
877
procedure CloseahiLibrary;
879
ExitProc := ahi_exit;
880
if AHIBase <> nil then begin
881
CloseLibrary(AHIBase);
886
procedure InitAHILibrary;
889
AHIBase := OpenLibrary(AHINAME,LIBVERSION);
890
if AHIBase <> nil then begin
891
ahi_exit := ExitProc;
892
ExitProc := @CloseahiLibrary;
894
MessageBox('FPC Pascal Error',
895
'Can''t open ahi.library version ' + VERSION + #10 +
896
'Deallocating resources and closing down',
903
AHIIsCompiledHow := 2;
904
{$endif use_init_openlib}
906
{$ifdef use_auto_openlib}
907
{$Info Compiling autoopening of ahi.library}
912
procedure CloseahiLibrary;
914
ExitProc := ahi_exit;
915
if AHIBase <> nil then begin
916
CloseLibrary(AHIBase);
923
AHIBase := OpenLibrary(AHINAME,LIBVERSION);
924
if AHIBase <> nil then begin
925
ahi_exit := ExitProc;
926
ExitProc := @CloseahiLibrary;
927
AHIIsCompiledHow := 1;
929
MessageBox('FPC Pascal Error',
930
'Can''t open ahi.library version ' + VERSION + #10 +
931
'Deallocating resources and closing down',
936
{$endif use_auto_openlib}
938
{$ifdef dont_use_openlib}
940
AHIIsCompiledHow := 3;
941
{$Warning No autoopening of ahi.library compiled}
942
{$Warning Make sure you open ahi.library yourself}
943
{$endif dont_use_openlib}