-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathXACT.pas
1855 lines (1597 loc) · 81.7 KB
/
XACT.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{******************************************************************************}
{* *}
{* Copyright (C) Microsoft Corporation. All Rights Reserved. *}
{* *}
{* Files: xact.h, xact2wb.h, xact3D.h *}
{* Content: XACT public interfaces, functions and data types; *}
{* XACT 2 wave bank definitions; XACT 3D support. *}
{* *}
{* DirectX 9.0 Delphi / FreePascal adaptation by Alexey Barkovoy *}
{* E-Mail: directx@clootie.ru *}
{* *}
{* Latest version can be downloaded from: *}
{* http://www.clootie.ru *}
{* http://sourceforge.net/projects/delphi-dx9sdk *}
{* *}
{*----------------------------------------------------------------------------*}
{* $Id: xact.pas,v 1.14 2007/04/14 20:57:43 clootie Exp $ }
{******************************************************************************}
{ }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ The contents of this file are used with permission, subject to the Mozilla }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License. }
{ }
{ Alternatively, the contents of this file may be used under the terms of the }
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
{ provisions of the LGPL License are applicable instead of those above. }
{ If you wish to allow use of your version of this file only under the terms }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting the provisions above and }
{ replace them with the notice and other provisions required by the LGPL }
{ License. If you do not delete the provisions above, a recipient may use }
{ your version of this file under either the MPL or the LGPL License. }
{ }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ }
{******************************************************************************}
{$I DirectX.inc}
unit xact;
interface
(*$HPPEMIT '#include "xact.h"' *)
(*$HPPEMIT '#include "xact2wb.h"' *)
(*$HPPEMIT '#include "xact3D.h"' *)
uses
{$IFDEF XBOX}XAudio, xauddefs{$ELSE}Windows, ActiveX{$ENDIF}, X3DAudio;
type
UINT32 = Longword;
(***************************************************************************
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: xact2wb.h
* Content: XACT 2 wave bank definitions.
*
****************************************************************************)
{$MINENUMSIZE 1}
const
WAVEBANK_HEADER_SIGNATURE = 'DNBW'; // WaveBank RIFF chunk signature
{$EXTERNALSYM WAVEBANK_HEADER_SIGNATURE}
WAVEBANK_HEADER_VERSION = 42; // Current wavebank file version
{$EXTERNALSYM WAVEBANK_HEADER_VERSION}
WAVEBANK_BANKNAME_LENGTH = 64; // Wave bank friendly name length, in characters
{$EXTERNALSYM WAVEBANK_BANKNAME_LENGTH}
WAVEBANK_ENTRYNAME_LENGTH = 64; // Wave bank entry friendly name length, in characters
{$EXTERNALSYM WAVEBANK_ENTRYNAME_LENGTH}
WAVEBANK_MAX_DATA_SEGMENT_SIZE = $FFFFFFFF; // Maximum wave bank data segment size, in bytes
{$EXTERNALSYM WAVEBANK_MAX_DATA_SEGMENT_SIZE}
WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE = $001FFFFF; // Maximum compact wave bank data segment size, in bytes
{$EXTERNALSYM WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE}
type
WAVEBANKOFFSET = DWORD;
{$EXTERNALSYM WAVEBANKOFFSET}
TWavebankOffset = WAVEBANKOFFSET;
const
//
// Bank flags
//
WAVEBANK_TYPE_BUFFER = $00000000; // In-memory buffer
{$EXTERNALSYM WAVEBANK_TYPE_BUFFER}
WAVEBANK_TYPE_STREAMING = $00000001; // Streaming
{$EXTERNALSYM WAVEBANK_TYPE_STREAMING}
WAVEBANK_TYPE_MASK = $00000001;
{$EXTERNALSYM WAVEBANK_TYPE_MASK}
WAVEBANK_FLAGS_ENTRYNAMES = $00010000; // Bank includes entry names
{$EXTERNALSYM WAVEBANK_FLAGS_ENTRYNAMES}
WAVEBANK_FLAGS_COMPACT = $00020000; // Bank uses compact format
{$EXTERNALSYM WAVEBANK_FLAGS_COMPACT}
WAVEBANK_FLAGS_SYNC_DISABLED = $00040000; // Bank is disabled for audition sync
{$EXTERNALSYM WAVEBANK_FLAGS_SYNC_DISABLED}
WAVEBANK_FLAGS_SEEKTABLES = $00080000; // Bank includes seek tables.
{$EXTERNALSYM WAVEBANK_FLAGS_SEEKTABLES}
WAVEBANK_FLAGS_MASK = $000F0000;
{$EXTERNALSYM WAVEBANK_FLAGS_MASK}
//
// Entry flags
//
WAVEBANKENTRY_FLAGS_READAHEAD = $00000001; // Enable stream read-ahead
{$EXTERNALSYM WAVEBANKENTRY_FLAGS_READAHEAD}
WAVEBANKENTRY_FLAGS_LOOPCACHE = $00000002; // One or more looping sounds use this wave
{$EXTERNALSYM WAVEBANKENTRY_FLAGS_LOOPCACHE}
WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL = $00000004; // Remove data after the end of the loop region
{$EXTERNALSYM WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL}
WAVEBANKENTRY_FLAGS_IGNORELOOP = $00000008; // Used internally when the loop region can't be used
{$EXTERNALSYM WAVEBANKENTRY_FLAGS_IGNORELOOP}
WAVEBANKENTRY_FLAGS_MASK = $00000008;
{$EXTERNALSYM WAVEBANKENTRY_FLAGS_MASK}
//
// Entry wave format identifiers
//
WAVEBANKMINIFORMAT_TAG_PCM = $0; // PCM data
{$EXTERNALSYM WAVEBANKMINIFORMAT_TAG_PCM}
WAVEBANKMINIFORMAT_TAG_XMA = $1; // XMA data
{$EXTERNALSYM WAVEBANKMINIFORMAT_TAG_XMA}
WAVEBANKMINIFORMAT_TAG_ADPCM = $2; // ADPCM data
{$EXTERNALSYM WAVEBANKMINIFORMAT_TAG_ADPCM}
WAVEBANKMINIFORMAT_TAG_WMA = $3; // WMA data
{$EXTERNALSYM WAVEBANKMINIFORMAT_TAG_WMA}
WAVEBANKMINIFORMAT_BITDEPTH_8 = $0; // 8-bit data (PCM only)
{$EXTERNALSYM WAVEBANKMINIFORMAT_BITDEPTH_8}
WAVEBANKMINIFORMAT_BITDEPTH_16 = $1; // 16-bit data (PCM only)
{$EXTERNALSYM WAVEBANKMINIFORMAT_BITDEPTH_16}
//
// Arbitrary fixed sizes
//
WAVEBANKENTRY_XMASTREAMS_MAX = 3; // enough for 5.1 channel audio
{$EXTERNALSYM WAVEBANKENTRY_XMASTREAMS_MAX}
WAVEBANKENTRY_XMACHANNELS_MAX = 6; // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX)
{$EXTERNALSYM WAVEBANKENTRY_XMACHANNELS_MAX}
//
// DVD data sizes
//
WAVEBANK_DVD_SECTOR_SIZE = 2048;
{$EXTERNALSYM WAVEBANK_DVD_SECTOR_SIZE}
WAVEBANK_DVD_BLOCK_SIZE = (WAVEBANK_DVD_SECTOR_SIZE * 16);
{$EXTERNALSYM WAVEBANK_DVD_BLOCK_SIZE}
//
// Bank alignment presets
//
WAVEBANK_ALIGNMENT_MIN = 4; // Minimum alignment
{$EXTERNALSYM WAVEBANK_ALIGNMENT_MIN}
WAVEBANK_ALIGNMENT_DVD = WAVEBANK_DVD_SECTOR_SIZE; // DVD-optimized alignment
{$EXTERNALSYM WAVEBANK_ALIGNMENT_DVD}
//type
//
// Wave bank segment identifiers
//
//todo: What is size of this ENUM ???
// PWavebankSegIDX = ^TWavebankSegIDX;
// WAVEBANKSEGIDX =
// (
// WAVEBANK_SEGIDX_BANKDATA{= 0} = 0, // Bank data
// WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data
// WAVEBANK_SEGIDX_SEEKTABLES, // Storage for seek tables for the encoded waves.
// WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names
// WAVEBANK_SEGIDX_ENTRYWAVEDATA // Entry wave data
// // WAVEBANK_SEGIDX_COUNT
// );
// {$EXTERNALSYM WAVEBANKSEGIDX}
// TWavebankSegIDX = WAVEBANKSEGIDX;
const
// Wave bank segment identifiers
WAVEBANK_SEGIDX_BANKDATA = 0; // Bank data
WAVEBANK_SEGIDX_ENTRYMETADATA = 1; // Entry meta-data
WAVEBANK_SEGIDX_SEEKTABLES = 2; // Storage for seek tables for the encoded waves.
WAVEBANK_SEGIDX_ENTRYNAMES = 3; // Entry friendly names
WAVEBANK_SEGIDX_ENTRYWAVEDATA = 4; // Entry wave data
WAVEBANK_SEGIDX_COUNT = 5; // Total count of all segment identifiers
//WAVEBANK_SEGIDX_COUNT = Ord(High(TWavebankSegIDX))+1;
//{$EXTERNALSYM WAVEBANK_SEGIDX_COUNT}
//
// Endianness
//
procedure SwapBytes(_dw_: PDWORD); overload;
{$EXTERNALSYM SwapBytes}
procedure SwapBytes(w: PWORD); overload;
{$EXTERNALSYM SwapBytes}
//
// Wave bank region in bytes.
//
type
PWavebankRegion = ^TWavebankRegion;
WAVEBANKREGION = record
dwOffset: DWORD; // Region offset, in bytes.
dwLength: DWORD; // Region length, in bytes.
end;
{$EXTERNALSYM WAVEBANKREGION}
TWavebankRegion = WAVEBANKREGION;
//procedure TWavebankRegion_SwapBytes(var wbr: TWavebankRegion);
//
// Wave bank region in samples.
//
PWavebankSampleRegion = ^TWavebankSampleRegion;
WAVEBANKSAMPLEREGION = record
dwStartSample: DWORD; // Start sample for the region.
dwTotalSamples: DWORD; // Region length in samples.
(*
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(dwStartSample);
XACTWaveBank::SwapBytes(dwTotalSamples);
} *)
end;
{$EXTERNALSYM WAVEBANKSAMPLEREGION}
TWavebankSampleRegion = WAVEBANKSAMPLEREGION;
//
// Wave bank file header
//
type
PWavebankHeader = ^TWavebankHeader;
WAVEBANKHEADER = record
dwSignature: DWORD; // File signature
dwVersion: DWORD; // Version of the tool that created the file
dwHeaderVersion: DWORD; // Version of the file format
Segments: array[0..WAVEBANK_SEGIDX_COUNT-1] of TWavebankRegion; // Segment lookup table
end;
{$EXTERNALSYM WAVEBANKHEADER}
TWavebankHeader = WAVEBANKHEADER;
//procedure TWavebankHeader_SwapBytes(var wbh: TWavebankHeader);
//
// Entry compressed data format
//
type
PWavebankMiniWaveFormat = ^TWavebankMiniWaveFormat;
WAVEBANKMINIWAVEFORMAT = record
//struct
{
DWORD wFormatTag : 2; // Format tag
DWORD nChannels : 3; // Channel count (1 - 6)
DWORD nSamplesPerSec : 18; // Sampling rate
DWORD wBlockAlign : 8; // Block alignment
DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only)
}
dwValue: DWORD;
end;
{$EXTERNALSYM WAVEBANKMINIWAVEFORMAT}
TWavebankMiniWaveFormat = WAVEBANKMINIWAVEFORMAT;
//procedure TWavebankMiniWaveFormat_SwapBytes(var wbmwf: TWavebankMiniWaveFormat);
//function TWavebankMiniWaveFormat_BitsPerSample(): Word;
//function TWavebankMiniWaveFormat_BlockAlign(): DWPRD;
//
// Entry meta-data
//
PWavebankEntry = ^TWavebankEntry;
WAVEBANKENTRY = record
//union
//struct
{
// Entry flags
DWORD dwFlags : 4;
// Duration of the wave, in units of one sample.
// For instance, a ten second long wave sampled
// at 48KHz would have a duration of 480,000.
// This value is not affected by the number of
// channels, the number of bits per sample, or the
// compression format of the wave.
DWORD Duration : 28;
}
dwFlagsAndDuration: DWORD;
//};
Format: TWavebankMiniWaveFormat; // Entry format
PlayRegion: TWavebankRegion; // Region within the wave data segment that contains this entry
LoopRegion: TWavebankSampleRegion;// Region within the wave data (in samples) that should loop.
end;
{$EXTERNALSYM WAVEBANKENTRY}
TWavebankEntry = WAVEBANKENTRY;
//
// Compact entry meta-data
//
PWavebankEntryCompact = ^TWavebankEntryCompact;
WAVEBANKENTRYCOMPACT = record
{DWORD dwOffset : 21; // Data offset, in sectors
DWORD dwLengthDeviation : 11; // Data length deviation, in bytes}
dwValue: DWORD;
end;
{$EXTERNALSYM WAVEBANKENTRYCOMPACT}
TWavebankEntryCompact = WAVEBANKENTRYCOMPACT;
//
// Bank data segment
//
PWavebankData = ^TWavebankData;
WAVEBANKDATA = record
dwFlags: DWORD; // Bank flags
dwEntryCount: DWORD; // Number of entries in the bank
szBankName: array [0..WAVEBANK_BANKNAME_LENGTH-1] of AnsiChar; // Bank friendly name
dwEntryMetaDataElementSize: DWORD; // Size of each entry meta-data element, in bytes
dwEntryNameElementSize: DWORD; // Size of each entry name element, in bytes
dwAlignment: DWORD; // Entry alignment, in bytes
CompactFormat: TWavebankMiniWaveFormat; // Format data for compact bank
BuildTime: FILETIME; // Build timestamp
end;
{$EXTERNALSYM WAVEBANKDATA}
TWavebankData = WAVEBANKDATA;
{$MINENUMSIZE 4}
(***************************************************************************
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: xact.h
* Content: XACT public interfaces, functions and data types
*
****************************************************************************)
{$IFDEF XBOX}
type
//XBox compatibility types - not needed in real XBox SDK
PXAudioVoiceOutput = Pointer;
PXAudioVoiceOutputVolume = Pointer;
PXACTCueProperties = Pointer;
{$ENDIF}
//------------------------------------------------------------------------------
// XACT class and interface IDs (Version 2.7)
//------------------------------------------------------------------------------
{$IFNDEF XBOX} // XACT COM support only exists on Windows
const
CLSID_XACTEngine: TGUID = '{cd0d66ec-8057-43f5-acbd-66dfb36fd78c}';
CLSID_XACTAuditionEngine: TGUID = '{9b94bf7a-ce0f-4c68-8b5e-d062cb3730c3}';
CLSID_XACTDebugEngine: TGUID = '{1bd54a4b-a1dc-4e4c-92a2-73ed33552148}';
// will be defined later -> IID_IXACTEngine: TGUID = '{c2f0af68-1f6d-40ed-964f-26256842edc4}';
{$EXTERNALSYM CLSID_XACTEngine}
{$EXTERNALSYM CLSID_XACTAuditionEngine}
{$EXTERNALSYM CLSID_XACTDebugEngine}
{$ENDIF}
//------------------------------------------------------------------------------
// Forward Declarations
//------------------------------------------------------------------------------
{$IFNDEF XBOX}
const
XACT_RENDERER_ID_LENGTH = $ff; // Maximum number of characters allowed in the renderer ID
{$EXTERNALSYM XACT_RENDERER_ID_LENGTH}
XACT_RENDERER_NAME_LENGTH = $ff; // Maximum number of characters allowed in the renderer display name.
{$EXTERNALSYM XACT_RENDERER_NAME_LENGTH}
// -----------------------------------------------------------------------------
// Engine Look-Ahead Time
// -----------------------------------------------------------------------------
XACT_ENGINE_LOOKAHEAD_DEFAULT = 250; // Default look-ahead time of 250ms can be used during XACT engine initialization.
{$EXTERNALSYM XACT_ENGINE_LOOKAHEAD_DEFAULT}
{$ENDIF}
// -----------------------------------------------------------------------------
// Cue friendly name length
// -----------------------------------------------------------------------------
XACT_CUE_NAME_LENGTH = $FF;
{$EXTERNALSYM XACT_CUE_NAME_LENGTH}
type
IXACTSoundBank = class;
IXACTWaveBank = class;
IXACTWave = class;
IXACTCue = class;
PXACT_Notification = ^TXACT_Notification;
PIXACTCue = ^IXACTCue;
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
TXACTIndex = Word; // All normal indices
TXACTNotificationType = Byte; // Notification type
TXACTVariableValue = Single; // Variable value
TXACTVariableIndex = Word; // Variable index
TXACTCategory = Word; // Sound category
TXACTChannel = Byte; // Audio channel
TXACTVolume = Single; // Volume value
TXACTTime = Longint; // Time (in ms)
TXACTPitch = Smallint; // Pitch value
TXACTLoopCount = Byte; // For all loops / recurrences
TXACTVariationWeight = Byte; // Variation weight
TXACTPriority = Byte; // Sound priority
TXACTInstanceLimit = Byte; // Instance limitations
PXACTIndex = ^TXACTIndex;
PXACTNotificationType = ^TXACTNotificationType;
PXACTVariableValue = ^TXACTVariableValue;
PXACTVariableIndex = ^TXACTVariableIndex;
PXACTCategory = ^TXACTCategory;
PXACTChannel = ^TXACTChannel;
PXACTVolume = ^TXACTVolume;
PXACTTime = ^TXACTTime;
PXACTPitch = ^TXACTPitch;
PXACTLoopCount = ^TXACTLoopCount;
PXACTVariationWeight = ^TXACTVariationWeight;
PXACTPriority = ^TXACTPriority;
PXACTInstanceLimit = ^TXACTInstanceLimit;
XACTINDEX = TXACTIndex;
XACTNOTIFICATIONTYPE = TXACTNotificationType;
XACTVARIABLEVALUE = TXACTVariableValue;
XACTVARIABLEINDEX = TXACTVariableIndex;
XACTCATEGORY = TXACTCategory;
XACTCHANNEL = TXACTChannel;
XACTVOLUME = TXACTVolume;
XACTTIME = TXACTTime;
XACTPITCH = TXACTPitch;
XACTLOOPCOUNT = TXACTLoopCount;
XACTVARIATIONWEIGHT = TXACTVariationWeight;
XACTPRIORITY = TXACTPriority;
XACTINSTANCELIMIT = TXACTInstanceLimit;
{$NODEFINE XACTINDEX}
{$NODEFINE XACTNOTIFICATIONTYPE}
{$NODEFINE XACTVARIABLEVALUE}
{$NODEFINE XACTVARIABLEINDEX}
{$NODEFINE XACTCATEGORY}
{$NODEFINE XACTCHANNEL}
{$NODEFINE XACTVOLUME}
{$NODEFINE XACTTIME}
{$NODEFINE XACTPITCH}
{$NODEFINE XACTLOOPCOUNT}
{$NODEFINE XACTVARIATIONWEIGHT}
{$NODEFINE XACTPRIORITY}
{$NODEFINE XACTINSTANCELIMIT}
{$NODEFINE TXACTINDEX}
{$NODEFINE TXACTNOTIFICATIONTYPE}
{$NODEFINE TXACTVARIABLEVALUE}
{$NODEFINE TXACTVARIABLEINDEX}
{$NODEFINE TXACTCATEGORY}
{$NODEFINE TXACTCHANNEL}
{$NODEFINE TXACTVOLUME}
{$NODEFINE TXACTTIME}
{$NODEFINE TXACTPITCH}
{$NODEFINE TXACTLOOPCOUNT}
{$NODEFINE TXACTVARIATIONWEIGHT}
{$NODEFINE TXACTPRIORITY}
{$NODEFINE TXACTINSTANCELIMIT}
{$HPPEMIT 'typedef XACTINDEX TXACTIndex'}
{$HPPEMIT 'typedef XACTNOTIFICATIONTYPE TXACTNotificationType'}
{$HPPEMIT 'typedef XACTVARIABLEVALUE TXACTVariableValue'}
{$HPPEMIT 'typedef XACTVARIABLEINDEX TXACTVariableIndex'}
{$HPPEMIT 'typedef XACTCATEGORY TXACTCategory'}
{$HPPEMIT 'typedef XACTCHANNEL TXACTChanel'}
{$HPPEMIT 'typedef XACTVOLUME TXACTVolume'}
{$HPPEMIT 'typedef XACTTIME TXACTTime'}
{$HPPEMIT 'typedef XACTPITCH TXACTPitch'}
{$HPPEMIT 'typedef XACTLOOPCOUNT TXACTLoopCount'}
{$HPPEMIT 'typedef XACTVARIATIONWEIGHT TXACTVariationWeight'}
{$HPPEMIT 'typedef XACTPRIORITY TXACTPriority'}
{$HPPEMIT 'typedef XACTINSTANCELIMIT TXACTInstanceLimit'}
//------------------------------------------------------------------------------
// Standard win32 multimedia definitions
//------------------------------------------------------------------------------
PWaveFormatEx = ^TWaveFormatEx;
{$EXTERNALSYM tWAVEFORMATEX}
tWAVEFORMATEX = packed record
wFormatTag: Word; { format type }
nChannels: Word; { number of channels (i.e. mono, stereo, etc.) }
nSamplesPerSec: DWORD; { sample rate }
nAvgBytesPerSec: DWORD; { for buffer estimation }
nBlockAlign: Word; { block size of data }
wBitsPerSample: Word; { number of bits per sample of mono data }
cbSize: Word; { the count in bytes of the size of }
end;
//
// The WAVEFORMATEXTENSIBLE structure defines the format of waveform-audio data for formats having more than two channels.
// This structure is part of the Platform SDK and is not declared in Dsound.h. It is included here for convenience.
//
TWaveFormatExtensibleSamples = record
case byte of
0: (wValidBitsPerSample : Word); // bits of precision
1: (wSamplesPerBlock : Word); // valid if wBitsPerSample = 0
2: (wReserved : Word); // If neither applies, set to zero.
end;
{$EXTERNALSYM TWaveFormatExtensibleSamples}
//Clootie: TWaveFormatExtensible definition is borrowed from DirectShow.pas
PWaveFormatExtensible = ^TWaveFormatExtensible;
WAVEFORMATEXTENSIBLE = record
Format: TWaveFormatEx;
Samples: TWaveFormatExtensibleSamples;
dwChannelMask : DWORD; // which channels are present in stream
SubFormat : TGUID;
end;
{$EXTERNALSYM WAVEFORMATEXTENSIBLE}
TWaveFormatExtensible = WAVEFORMATEXTENSIBLE;
// -----------------------------------------------------------------------------
// File IO Callbacks
// -----------------------------------------------------------------------------
{$NODEFINE TXACT_ReadFile_Callback}
TXACT_ReadFile_Callback = function (hFile: THandle; lpBuffer: Pointer; nNumberOfBytesToRead: DWORD;
lpNumberOfBytesRead: PDWORD; lpOverlapped: POverlapped): BOOL; stdcall;
{$NODEFINE TXACT_GetOverlappedResult_Callback}
TXACT_GetOverlappedResult_Callback = function (hFile: THandle; lpOverlapped: POverlapped;
lpNumberOfBytesTransferred: PDWORD; bWait: BOOL): BOOL; stdcall;
PXACT_FileIO_Callbacks = ^TXACT_FileIO_Callbacks;
XACT_FILEIO_CALLBACKS = record
readFileCallback: TXACT_ReadFile_Callback;
getOverlappedResultCallback: TXACT_GetOverlappedResult_Callback;
end;
{$EXTERNALSYM XACT_FILEIO_CALLBACKS}
TXACT_FileIO_Callbacks = XACT_FILEIO_CALLBACKS;
// -----------------------------------------------------------------------------
// Notification Callback
// -----------------------------------------------------------------------------
TXACT_Notification_Callback = procedure (const pNotification: PXACT_Notification); stdcall;
{$EXTERNALSYM TXACT_Notification_Callback}
{$IFNDEF XBOX}
// -----------------------------------------------------------------------------
// Renderer Details
// -----------------------------------------------------------------------------
PXACT_Renderer_Details = ^TXACT_Renderer_Details;
XACT_RENDERER_DETAILS = record
rendererID: array[0..XACT_RENDERER_ID_LENGTH-1] of WideChar; // The string ID for the rendering device.
displayName: array[0..XACT_RENDERER_NAME_LENGTH-1] of WideChar; // A friendly name suitable for display to a human.
defaultDevice: BOOL; // Set to TRUE if this device is the primary audio device on the system.
end;
{$EXTERNALSYM XACT_RENDERER_DETAILS}
TXACT_Renderer_Details = XACT_RENDERER_DETAILS;
TXACTRendererDetails = XACT_RENDERER_DETAILS;
PXACTRendererDetails = PXACT_Renderer_Details;
{$ENDIF}
// -----------------------------------------------------------------------------
// Runtime (engine) parameters
// -----------------------------------------------------------------------------
PXACT_Runtime_Parameters = ^TXACT_Runtime_Parameters;
XACT_RUNTIME_PARAMETERS = record
lookAheadTime: DWORD; // Time in ms
pGlobalSettingsBuffer: Pointer; // Buffer containing the global settings file
globalSettingsBufferSize: DWORD; // Size of global settings buffer
globalSettingsFlags: DWORD; // Flags for global settings
globalSettingsAllocAttributes: DWORD; // Global settings buffer allocation attributes (see XMemAlloc)
fileIOCallbacks: TXACT_FileIO_Callbacks; // File I/O callbacks
fnNotificationCallback: TXACT_Notification_Callback; // Callback that receives notifications.
{$IFNDEF XBOX}
pRendererID: PWideChar; // Ptr to the ID for the audio renderer the engine should connect to.
{$ENDIF}
end;
{$EXTERNALSYM XACT_RUNTIME_PARAMETERS}
TXACT_Runtime_Parameters = XACT_RUNTIME_PARAMETERS;
//------------------------------------------------------------------------------
// Streaming Parameters
//------------------------------------------------------------------------------
PXACT_Streaming_Parameters = ^TXACT_Streaming_Parameters;
PXACT_Wavebank_Streaming_Parameters = ^TXACT_Wavebank_Streaming_Parameters;
XACT_STREAMING_PARAMETERS = record
file_: THandle; // File handle associated with wavebank data
offset: DWORD; // Offset within file of wavebank header (must be sector aligned)
flags: DWORD; // Flags (none currently)
packetSize: Word; // Stream packet size (in sectors) to use for each stream (min = 2)
// number of sectors (DVD = 2048 bytes: 2 = 4096, 3 = 6144, 4 = 8192 etc.)
// optimal DVD size is a multiple of 16 (DVD block = 16 DVD sectors)
end;
{$EXTERNALSYM XACT_STREAMING_PARAMETERS}
XACT_WAVEBANK_STREAMING_PARAMETERS = XACT_STREAMING_PARAMETERS;
{$EXTERNALSYM XACT_WAVEBANK_STREAMING_PARAMETERS}
TXACT_Streaming_Parameters = XACT_STREAMING_PARAMETERS;
TXACT_Wavebank_Streaming_Parameters = XACT_STREAMING_PARAMETERS;
// Structure used to report cue properties back to the client.
PXACT_Cue_Properties = ^TXACT_Cue_Properties;
XACT_CUE_PROPERTIES = record
friendlyName: array [0..XACT_CUE_NAME_LENGTH-1] of Char; // Empty if the soundbank doesn't contain any friendly names
interactive: BOOL; // TRUE if an IA cue; FALSE otherwise
iaVariableIndex: TXACTIndex; // Only valid for IA cues; XACTINDEX_INVALID otherwise
numVariations: TXACTIndex; // Number of variations in the cue
maxInstances: TXACTInstanceLimit; // Number of maximum instances for this cue
currentInstances: TXACTInstanceLimit; // Current active instances of this cue
end;
{$EXTERNALSYM XACT_CUE_PROPERTIES}
TXACT_Cue_Properties = XACT_CUE_PROPERTIES;
// Strucutre used to return the track properties.
PXACT_Track_Properties = ^TXACT_Track_Properties;
XACT_TRACK_PROPERTIES = record
duration: TXACTTime; // Duration of the track in ms
numVariations: TXACTIndex; // Number of wave variations in the track
numChannels: TXACTChannel; // Number of channels for the active wave variation on this track
waveVariation: TXACTIndex; // Index of the active wave variation
loopCount: TXACTLoopCount; // Current loop count on this track
end;
{$EXTERNALSYM XACT_TRACK_PROPERTIES}
TXACT_Track_Properties = XACT_TRACK_PROPERTIES;
// Structure used to return the properties of a variation.
PXACT_Variation_Properties = ^TXACT_Variation_Properties;
XACT_VARIATION_PROPERTIES = record
index: TXACTIndex; // Index of the variation in the cue's variation list
weight: TXACTVariationWeight; // Weight for the active variation. Valid only for complex cues
iaVariableMin: TXACTVariableValue; // Valid only for IA cues
iaVariableMax: TXACTVariableValue; // Valid only for IA cues
linger: BOOL; // Valid only for IA cues
end;
{$EXTERNALSYM XACT_VARIATION_PROPERTIES}
TXACT_Variation_Properties = XACT_VARIATION_PROPERTIES;
// Structure used to return the properties of the sound referenced by a variation.
PXACT_Sound_Properties = ^TXACT_Sound_Properties;
XACT_SOUND_PROPERTIES = record
category: TXACTCategory; // Category this sound belongs to
priority: Byte; // Priority of this variation
pitch: TXACTPitch; // Current pitch set on the active variation
volume: TXACTVolume; // Current volume set on the active variation
numTracks: TXACTIndex; // Number of tracks in the active variation
arrTrackProperties: array [0..0] of TXACT_Track_Properties; // Array of active track properties (has numTracks number of elements)
end;
{$EXTERNALSYM XACT_SOUND_PROPERTIES}
TXACT_Sound_Properties = XACT_SOUND_PROPERTIES;
// Structure used to return the properties of the active variation and the sound referenced.
PXACT_Sound_Variation_Properties = ^TXACT_Sound_Variation_Properties;
XACT_SOUND_VARIATION_PROPERTIES = record
variationProperties: TXACT_Variation_Properties; // Properties for this variation
soundProperties: TXACT_Sound_Properties; // Proeprties for the sound referenced by this variation
end;
{$EXTERNALSYM XACT_SOUND_VARIATION_PROPERTIES}
TXACT_Sound_Variation_Properties = XACT_SOUND_VARIATION_PROPERTIES;
// Structure used to return the properties of an active cue instance.
PXACT_Cue_Instance_Properties = ^TXACT_Cue_Instance_Properties;
XACT_CUE_INSTANCE_PROPERTIES = record
allocAttributes: DWORD; // Buffer allocation attributes (see XMemAlloc)
cueProperties: TXACT_Cue_Properties; // Properties of the cue that are shared by all instances.
activeVariationProperties: TXACT_Sound_Variation_Properties; // Properties if the currently active variation.
end;
{$EXTERNALSYM XACT_CUE_INSTANCE_PROPERTIES}
TXACT_Cue_Instance_Properties = XACT_CUE_INSTANCE_PROPERTIES;
// Structure used to return the common wave properties.
PXACT_Wave_Properties = ^TXACT_Wave_Properties;
XACT_WAVE_PROPERTIES = record
friendlyName: array[0..WAVEBANK_ENTRYNAME_LENGTH-1] of Char; // Friendly name for the wave; empty if the wavebank doesn't contain friendly names.
format: TWavebankMiniWaveFormat; // Format for the wave.
durationInSamples: DWORD; // Duration of the wave in units of one sample
loopRegion: TWavebankSampleRegion; // Loop region defined in samples.
streaming: BOOL; // Set to TRUE if the wave is streaming; FALSE otherwise.
end;
{$EXTERNALSYM XACT_WAVE_PROPERTIES}
TXACT_Wave_Properties = XACT_WAVE_PROPERTIES;
// Structure used to return the properties specific to a wave instance.
PXACT_Wave_Instance_Properties = ^TXACT_Wave_Instance_Properties;
XACT_WAVE_INSTANCE_PROPERTIES = record
properties: TXACT_Wave_Properties; // Static properties common to all the wave instances.
backgroundMusic: BOOL; // Set to TRUE if the wave is tagged as background music; FALSE otherwise.
end;
{$EXTERNALSYM XACT_WAVE_INSTANCE_PROPERTIES}
TXACT_Wave_Instance_Properties = XACT_WAVE_INSTANCE_PROPERTIES;
//------------------------------------------------------------------------------
// Channel Mapping / Speaker Panning
//------------------------------------------------------------------------------
PXACTChannelMapEntry = ^TXACTChannelMapEntry;
XACTCHANNELMAPENTRY = record
InputChannel: TXACTChannel;
OutputChannel: TXACTChannel;
Volume: TXACTVolume;
end;
{$EXTERNALSYM XACTCHANNELMAPENTRY}
TXACTChannelMapEntry = XACTCHANNELMAPENTRY;
PXACTChannelMap = ^TXACTChannelMap;
XACTCHANNELMAP = record
EntryCount: TXACTChannel;
paEntries: PXACTChannelMapEntry;
end;
{$EXTERNALSYM XACTCHANNELMAP}
TXACTChannelMap = XACTCHANNELMAP;
PXACTChannelVolumeEntry = ^TXACTChannelVolumeEntry;
XACTCHANNELVOLUMEENTRY = record
EntryIndex: TXACTChannel;
Volume: TXACTVolume;
end;
{$EXTERNALSYM XACTCHANNELVOLUMEENTRY}
TXACTChannelVolumeEntry = XACTCHANNELVOLUMEENTRY;
PXACTChannelVolume = ^TXACTChannelVolume;
XACTCHANNELVOLUME = record
EntryCount: TXACTChannel;
paEntries: PXACTChannelVolumeEntry;
end;
{$EXTERNALSYM XACTCHANNELVOLUME}
TXACTChannelVolume = XACTCHANNELVOLUME;
//------------------------------------------------------------------------------
// Notifications
//------------------------------------------------------------------------------
// Pack the notification structures
// Original C++ header: #pragma pack(push, 1)
// Notification description used for registering, un-registering and flushing notifications
PXACT_Notification_Description = ^TXACT_Notification_Description;
XACT_NOTIFICATION_DESCRIPTION = packed record
type_: TXACTNotificationType; // Notification type
flags: Byte; // Flags
pSoundBank: IXACTSoundBank; // SoundBank instance
pWaveBank: IXACTWaveBank; // WaveBank instance
pCue: IXACTCue; // Cue instance
pWave: IXACTWave; // Wave instance
cueIndex: TXACTIndex; // Cue index
waveIndex: TXACTIndex; // Wave index
pvContext: Pointer; // User context (optional)
end;
{$EXTERNALSYM XACT_NOTIFICATION_DESCRIPTION}
TXACT_Notification_Description = XACT_NOTIFICATION_DESCRIPTION;
// Notification structure for all XACTNOTIFICATIONTYPE_CUE* notifications
PXACT_Notification_Cue = ^TXACT_Notification_Cue;
XACT_NOTIFICATION_CUE = packed record
cueIndex: TXACTIndex; // Cue index
pSoundBank: IXACTSoundBank; // SoundBank instance
pCue: IXACTCue; // Cue instance
end;
{$EXTERNALSYM XACT_NOTIFICATION_CUE}
TXACT_Notification_Cue = XACT_NOTIFICATION_CUE;
// Notification structure for all XACTNOTIFICATIONTYPE_MARKER* notifications
PXACT_Notification_Marker = ^TXACT_Notification_Marker;
XACT_NOTIFICATION_MARKER = packed record
cueIndex: TXACTIndex; // Cue index
pSoundBank: IXACTSoundBank; // SoundBank instance
pCue: IXACTCue; // Cue instance
marker: DWORD; // Marker value
end;
{$EXTERNALSYM XACT_NOTIFICATION_MARKER}
TXACT_Notification_Marker = XACT_NOTIFICATION_MARKER;
// Notification structure for all XACTNOTIFICATIONTYPE_SOUNDBANK* notifications
PXACT_Notification_SoundBank = ^TXACT_Notification_SoundBank;
XACT_NOTIFICATION_SOUNDBANK = packed record
pSoundBank: IXACTSoundBank; // SoundBank instance
end;
{$EXTERNALSYM XACT_NOTIFICATION_SOUNDBANK}
TXACT_Notification_SoundBank = XACT_NOTIFICATION_SOUNDBANK;
// Notification structure for all XACTNOTIFICATIONTYPE_WAVEBANK* notifications
PXACT_Notification_WaveBank = ^TXACT_Notification_WaveBank;
XACT_NOTIFICATION_WAVEBANK = packed record
pWaveBank: IXACTWaveBank; // WaveBank instance
end;
{$EXTERNALSYM XACT_NOTIFICATION_WAVEBANK}
TXACT_Notification_WaveBank = XACT_NOTIFICATION_WAVEBANK;
// Notification structure for all XACTNOTIFICATIONTYPE_*VARIABLE* notifications
PXACT_Notification_Variable = ^TXACT_Notification_Variable;
XACT_NOTIFICATION_VARIABLE = packed record
cueIndex: TXACTIndex; // Cue index
pSoundBank: IXACTSoundBank; // SoundBank instance
pCue: IXACTCue; // Cue instance
variableIndex: TXACTVariableIndex; // Variable index
variableValue: TXACTVariableValue; // Variable value
local: BOOL; // TRUE if a local variable
end;
{$EXTERNALSYM XACT_NOTIFICATION_VARIABLE}
TXACT_Notification_Variable = XACT_NOTIFICATION_VARIABLE;
// Notification structure for all XACTNOTIFICATIONTYPE_GUI* notifications
PXACT_Notification_GUI = ^TXACT_Notification_GUI;
XACT_NOTIFICATION_GUI = packed record
reserved: DWORD; // Reserved
end;
{$EXTERNALSYM XACT_NOTIFICATION_GUI}
TXACT_Notification_GUI = XACT_NOTIFICATION_GUI;
// Notification structure for all XACTNOTIFICATIONTYPE_WAVE* notifications
PXACT_Notification_Wave = ^TXACT_Notification_Wave;
XACT_NOTIFICATION_WAVE = packed record
pWaveBank: IXACTWaveBank; // WaveBank
waveIndex: TXACTIndex; // Wave index
cueIndex: TXACTIndex; // Cue index
pSoundBank: IXACTSoundBank; // SoundBank instance
pCue: IXACTCue; // Cue instance
pWave: IXACTWave; // Wave instance
end;
{$EXTERNALSYM XACT_NOTIFICATION_WAVE}
TXACT_Notification_Wave = XACT_NOTIFICATION_WAVE;
// General notification structure
XACT_NOTIFICATION = packed record
type_: TXACTNotificationType; // Notification type
timeStamp: Longint; // Timestamp of notification (milliseconds)
pvContext: Pointer; // User context (optional)
case Byte of
1: (cue: TXACT_Notification_Cue); // XACTNOTIFICATIONTYPE_CUE*
2: (marker: TXACT_Notification_Marker); // XACTNOTIFICATIONTYPE_MARKER*
3: (soundBank: TXACT_Notification_SoundBank); // XACTNOTIFICATIONTYPE_SOUNDBANK*
4: (waveBank: TXACT_Notification_WaveBank); // XACTNOTIFICATIONTYPE_WAVEBANK*
5: (variable: TXACT_Notification_Variable); // XACTNOTIFICATIONTYPE_VARIABLE*
6: (gui: TXACT_Notification_GUI); // XACTNOTIFICATIONTYPE_GUI*
7: (wave: TXACT_Notification_Wave); // XACTNOTIFICATIONTYPE_WAVE*
end;
{$EXTERNALSYM XACT_NOTIFICATION}
TXACT_Notification = XACT_NOTIFICATION;
//Original C++ header: #pragma pack(pop)
//------------------------------------------------------------------------------
// IXACTSoundBank
//------------------------------------------------------------------------------
{$EXTERNALSYM IXACTSoundBank}
IXACTSoundBank = class
function GetCueIndex(szFriendlyName: PAnsiChar): TXACTIndex; virtual; stdcall; abstract;
function GetNumCues(pnNumCues: PXACTIndex): HResult; virtual; stdcall; abstract;
function GetCueProperties(nCueIndex: TXACTIndex; pProperties: PXACT_Cue_Properties): HResult; virtual; stdcall; abstract;
function Prepare(nCueIndex: TXACTIndex; dwFlags: DWORD; timeOffset: TXACTTime; out ppCue: IXACTCue): HResult; virtual; stdcall; abstract;
function Play(nCueIndex: TXACTIndex; dwFlags: DWORD; timeOffset: TXACTTime; ppCue: PIXACTCue): HResult; virtual; stdcall; abstract;
function Stop(nCueIndex: TXACTIndex; dwFlags: DWORD): HResult; virtual; stdcall; abstract;
{$WARNINGS OFF}
function Destroy: HResult; virtual; stdcall; abstract; //Clootie: This method is not related to Delphi TObject.Destroy
{$WARNINGS ON}
function GetState(out pdwState: DWORD): HResult; virtual; stdcall; abstract;
end;
//------------------------------------------------------------------------------
// IXACTWaveBank
//------------------------------------------------------------------------------
{$EXTERNALSYM IXACTWaveBank}
IXACTWaveBank = class
{$WARNINGS OFF}
function Destroy: HResult; virtual; stdcall; abstract; //Clootie: This method is not related to Delphi TObject.Destroy
{$WARNINGS ON}
function GetNumWaves(pnNumWaves: PXACTIndex): HResult; virtual; stdcall; abstract;
function GetWaveIndex(szFriendlyName: PAnsiChar): XACTINDEX; virtual; stdcall; abstract;
function GetWaveProperties(nWaveIndex: TXACTIndex; pWaveProperties: PXACT_Wave_Properties): HResult; virtual; stdcall; abstract;
function Prepare(nWaveIndex: TXACTIndex; dwFlags: DWORD; dwPlayOffset: DWORD; nLoopCount: TXACTLoopCount; out ppWave: IXACTWave): HResult; virtual; stdcall; abstract;
function Play(nWaveIndex: TXACTIndex; dwFlags: DWORD; dwPlayOffset: DWORD; nLoopCount: TXACTLoopCount; out ppWave: IXACTWave): HResult; virtual; stdcall; abstract;
function Stop(nWaveIndex: TXACTIndex; dwFlags: DWORD): HResult; virtual; stdcall; abstract;
function GetState(out pdwState: DWORD): HResult; virtual; stdcall; abstract;
end;
//------------------------------------------------------------------------------
// IXACTWave
//------------------------------------------------------------------------------
{$EXTERNALSYM IXACTWave}
IXACTWave = class
{$WARNINGS OFF}
function Destroy: HResult; virtual; stdcall; abstract; //Clootie: This method is not related to Delphi TObject.Destroy
{$WARNINGS ON}
function Play: HResult; virtual; stdcall; abstract;
function Stop(dwFlags: DWORD): HResult; virtual; stdcall; abstract;
function Pause(fPause: BOOL): HResult; virtual; stdcall; abstract;
function GetState(out pdwState: DWORD): HResult; virtual; stdcall; abstract;
function SetPitch(pitch: TXACTPitch): HResult; virtual; stdcall; abstract;
function SetVolume(volume: TXACTVolume): HResult; virtual; stdcall; abstract;
function SetMatrixCoefficients(uSrcChannelCount: UINT32; uDstChannelCount: UINT32; pMatrixCoefficients: PSingle): HResult; virtual; stdcall; abstract;
function GetProperties(out pProperties: TXACT_Wave_Instance_Properties): HResult; virtual; stdcall; abstract;
end;
//------------------------------------------------------------------------------
// IXACTCue
//------------------------------------------------------------------------------
{$EXTERNALSYM IXACTCue}
IXACTCue = class
function Play: HResult; virtual; stdcall; abstract;
function Stop(dwFlags: DWORD): HResult; virtual; stdcall; abstract;
function GetState(out pdwState: DWORD): HResult; virtual; stdcall; abstract;
{$WARNINGS OFF}
function Destroy: HResult; virtual; stdcall; abstract; //Clootie: This method is not related to Delphi TObject.Destroy
{$WARNINGS ON}
function GetChannelMap(pChannelMap: PXACTChannelMap; BufferSize: DWORD; pRequiredSize: PDWORD): HResult; virtual; stdcall; abstract;
function SetChannelMap(const pChannelMap: PXACTChannelMap): HResult; virtual; stdcall; abstract;
function GetChannelVolume(const pVolume: PXACTChannelVolume): HResult; virtual; stdcall; abstract;
function SetChannelVolume(const pVolume: PXACTChannelVolume): HResult; virtual; stdcall; abstract;
function SetMatrixCoefficients(uSrcChannelCount: LongWord; uDstChannelCount: LongWord; pMatrixCoefficients: PSingle): HResult; virtual; stdcall; abstract;
function GetVariableIndex(szFriendlyName: PAnsiChar): TXACTVariableIndex; virtual; stdcall; abstract;
function SetVariable(nIndex: TXACTVariableIndex; nValue: TXACTVariableValue): HResult; virtual; stdcall; abstract;
function GetVariable(nIndex: TXACTVariableIndex; out nValue: TXACTVariableValue): HResult; virtual; stdcall; abstract;
function Pause(fPause: BOOL): HResult; virtual; stdcall; abstract;
function GetProperties(out ppProperties: TXACT_Cue_Instance_Properties): HResult; virtual; stdcall; abstract;
{$IFDEF XBOX}
function SetVoiceOutput(pVoiceOutput: PXAudioVoiceOutput): HResult; virtual; stdcall; abstract;
function SetVoiceOutputVolume(pVolume: PXAudioVoiceOutputVolume): HResult; virtual; stdcall; abstract;
{$ENDIF} // _XBOX
end;
//------------------------------------------------------------------------------
// IXACTEngine
//------------------------------------------------------------------------------
{$EXTERNALSYM IXACTEngine}
{$IFDEF XBOX}
IXACTEngine = interface // !CORBA!
function AddRef: Cardinal; stdcall;
function Release: Cardinal; stdcall;
{$ELSE}
IXACTEngine = interface(IUnknown)
['{c2f0af68-1f6d-40ed-964f-26256842edc4}']
{$ENDIF}
{$IFNDEF XBOX}
function GetRendererCount(out pnRendererCount: TXACTIndex): HResult; stdcall;
function GetRendererDetails(nRendererIndex: TXACTIndex; out pRendererDetails: TXACTRendererDetails): HResult; stdcall;
{$ENDIF}
function GetFinalMixFormat(out pFinalMixFormat: TWaveFormatExtensible): HResult; stdcall;
function Initialize(const pParams: TXACT_Runtime_Parameters): HResult; stdcall;
function ShutDown: HResult; stdcall;
function DoWork: HResult; stdcall;
function CreateSoundBank(const pvBuffer: Pointer; dwSize: DWORD; dwFlags: DWORD; dwAllocAttributes: DWORD; out ppSoundBank: IXACTSoundBank): HResult; stdcall;
function CreateInMemoryWaveBank(const pvBuffer: Pointer; dwSize: DWORD; dwFlags: DWORD; dwAllocAttributes: DWORD; out ppWaveBank: IXACTWaveBank): HResult; stdcall;
function CreateStreamingWaveBank(const pParms: TXACT_Wavebank_Streaming_Parameters; out ppWaveBank: IXACTWaveBank): HResult; stdcall;
function PrepareWave(dwFlags: DWORD; szWavePath: PAnsiChar; wStreamingPacketSize: Word; dwAlignment: DWORD; dwPlayOffset: DWORD; nLoopCount: XACTLOOPCOUNT; out ppWave: IXACTWave): HResult; stdcall;