-
Notifications
You must be signed in to change notification settings - Fork 3
/
xact3.h
1551 lines (1266 loc) · 75.1 KB
/
xact3.h
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.
*
* Module Name:
*
* xact3.h
*
* Abstract:
*
* XACT public interfaces, functions and data types
*
**************************************************************************/
#pragma once
#ifndef _XACT3_H_
#define _XACT3_H_
//------------------------------------------------------------------------------
// XACT class and interface IDs (Version 3.7)
//------------------------------------------------------------------------------
#ifndef _XBOX // XACT COM support only exists on Windows
#include <comdecl.h> // For DEFINE_CLSID, DEFINE_IID and DECLARE_INTERFACE
DEFINE_CLSID(XACTEngine, bcc782bc, 6492, 4c22, 8c, 35, f5, d7, 2f, e7, 3c, 6e);
DEFINE_CLSID(XACTAuditionEngine, 9ecdd80d, 0e81, 40d8, 89, 03, 2b, f7, b1, 31, ac, 43);
DEFINE_CLSID(XACTDebugEngine, 02860630, bf3b, 42a8, b1, 4e, 91, ed, a2, f5, 1e, a5);
DEFINE_IID(IXACT3Engine, b1ee676a, d9cd, 4d2a, 89, a8, fa, 53, eb, 9e, 48, 0b);
#endif
// Ignore the rest of this header if only the GUID definitions were requested:
#ifndef GUID_DEFS_ONLY
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#ifndef _XBOX
#include <windows.h>
#include <objbase.h>
#include <float.h>
#endif
#include <limits.h>
#include <xact3wb.h>
#include <xaudio2.h>
//------------------------------------------------------------------------------
// Forward Declarations
//------------------------------------------------------------------------------
typedef struct IXACT3SoundBank IXACT3SoundBank;
typedef struct IXACT3WaveBank IXACT3WaveBank;
typedef struct IXACT3Cue IXACT3Cue;
typedef struct IXACT3Wave IXACT3Wave;
typedef struct IXACT3Engine IXACT3Engine;
typedef struct XACT_NOTIFICATION XACT_NOTIFICATION;
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
typedef WORD XACTINDEX; // All normal indices
typedef BYTE XACTNOTIFICATIONTYPE; // Notification type
typedef FLOAT XACTVARIABLEVALUE; // Variable value
typedef WORD XACTVARIABLEINDEX; // Variable index
typedef WORD XACTCATEGORY; // Sound category
typedef BYTE XACTCHANNEL; // Audio channel
typedef FLOAT XACTVOLUME; // Volume value
typedef LONG XACTTIME; // Time (in ms)
typedef SHORT XACTPITCH; // Pitch value
typedef BYTE XACTLOOPCOUNT; // For all loops / recurrences
typedef BYTE XACTVARIATIONWEIGHT; // Variation weight
typedef BYTE XACTPRIORITY; // Sound priority
typedef BYTE XACTINSTANCELIMIT; // Instance limitations
//------------------------------------------------------------------------------
// Standard win32 multimedia definitions
//------------------------------------------------------------------------------
#ifndef WAVE_FORMAT_IEEE_FLOAT
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#endif
#ifndef WAVE_FORMAT_EXTENSIBLE
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
#endif
#ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_
#pragma pack(push, 1)
typedef struct tWAVEFORMATEX
{
WORD wFormatTag; // format type
WORD nChannels; // number of channels (i.e. mono, stereo...)
DWORD nSamplesPerSec; // sample rate
DWORD nAvgBytesPerSec; // for buffer estimation
WORD nBlockAlign; // block size of data
WORD wBitsPerSample; // Number of bits per sample of mono data
WORD cbSize; // The count in bytes of the size of extra information (after cbSize)
} WAVEFORMATEX, *PWAVEFORMATEX;
typedef WAVEFORMATEX NEAR *NPWAVEFORMATEX;
typedef WAVEFORMATEX FAR *LPWAVEFORMATEX;
#pragma pack(pop)
#endif
#ifndef _WAVEFORMATEXTENSIBLE_
#define _WAVEFORMATEXTENSIBLE_
#pragma pack(push, 1)
typedef struct
{
WAVEFORMATEX Format; // WAVEFORMATEX data
union
{
WORD wValidBitsPerSample; // Bits of precision
WORD wSamplesPerBlock; // Samples per block of audio data, valid if wBitsPerSample==0
WORD wReserved; // Unused -- If neither applies, set to zero.
} Samples;
DWORD dwChannelMask; // Speaker usage bitmask
GUID SubFormat; // Sub-format identifier
} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
#pragma pack(pop)
#endif
//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
static const XACTTIME XACTTIME_MIN = LONG_MIN;
static const XACTTIME XACTTIME_MAX = LONG_MAX; // 24 days 20:31:23.647
static const XACTTIME XACTTIME_INFINITE = LONG_MAX;
static const XACTINSTANCELIMIT XACTINSTANCELIMIT_INFINITE = 0xff;
static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MIN = 0x00; // == 1 instance total (0 additional instances)
static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MAX = 0xfe; // == 255 instances total (254 additional instances)
static const XACTINDEX XACTINDEX_MIN = 0x0;
static const XACTINDEX XACTINDEX_MAX = 0xfffe;
static const XACTINDEX XACTINDEX_INVALID = 0xffff;
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MIN = 0x00;
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MAX = 0xff;
static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MIN = -FLT_MAX;
static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MAX = FLT_MAX;
static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MIN = 0x0000;
static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MAX = 0xfffe;
static const XACTVARIABLEINDEX XACTVARIABLEINDEX_INVALID = 0xffff;
static const XACTCATEGORY XACTCATEGORY_MIN = 0x0;
static const XACTCATEGORY XACTCATEGORY_MAX = 0xfffe;
static const XACTCATEGORY XACTCATEGORY_INVALID = 0xffff;
static const XACTCHANNEL XACTCHANNEL_MIN = 0;
static const XACTCHANNEL XACTCHANNEL_MAX = 0xFF;
static const XACTPITCH XACTPITCH_MIN = -1200; // pitch change allowable per individual content field
static const XACTPITCH XACTPITCH_MAX = 1200;
static const XACTPITCH XACTPITCH_MIN_TOTAL = -2400; // total allowable pitch change, use with IXACTWave.SetPitch()
static const XACTPITCH XACTPITCH_MAX_TOTAL = 2400;
static const XACTVOLUME XACTVOLUME_MIN = 0.0f;
static const XACTVOLUME XACTVOLUME_MAX = 16777216.0f; // Maximum acceptable volume level (2^24) - matches XAudio2 max volume
static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MIN = -FLT_MAX;
static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MAX = FLT_MAX;
static const XACTLOOPCOUNT XACTLOOPCOUNT_MIN = 0x0;
static const XACTLOOPCOUNT XACTLOOPCOUNT_MAX = 0xfe;
static const XACTLOOPCOUNT XACTLOOPCOUNT_INFINITE = 0xff;
static const DWORD XACTWAVEALIGNMENT_MIN = 2048;
#ifdef _XBOX
static const BYTE XACTMAXOUTPUTVOICECOUNT = 3;
#endif // _XBOX
// -----------------------------------------------------------------------------
// Cue friendly name length
// -----------------------------------------------------------------------------
#define XACT_CUE_NAME_LENGTH 0xFF
// -----------------------------------------------------------------------------
// Current Content Tool Version
// -----------------------------------------------------------------------------
#define XACT_CONTENT_VERSION 46
// -----------------------------------------------------------------------------
// XACT Stop Flags
// -----------------------------------------------------------------------------
static const DWORD XACT_FLAG_STOP_RELEASE = 0x00000000; // Stop with release envelope (or as authored), for looping waves this acts as break loop.
static const DWORD XACT_FLAG_STOP_IMMEDIATE = 0x00000001; // Stop immediately
// -----------------------------------------------------------------------------
// XACT Manage Data Flag - XACT will manage the lifetime of this data
// -----------------------------------------------------------------------------
static const DWORD XACT_FLAG_MANAGEDATA = 0x00000001;
// -----------------------------------------------------------------------------
// XACT Content Preparation Flags
// -----------------------------------------------------------------------------
static const DWORD XACT_FLAG_BACKGROUND_MUSIC = 0x00000002; // Marks the waves as background music.
static const DWORD XACT_FLAG_UNITS_MS = 0x00000004; // Indicates that the units passed in are in milliseconds.
static const DWORD XACT_FLAG_UNITS_SAMPLES = 0x00000008; // Indicates that the units passed in are in samples.
// -----------------------------------------------------------------------------
// XACT State flags
// -----------------------------------------------------------------------------
static const DWORD XACT_STATE_CREATED = 0x00000001; // Created, but nothing else
static const DWORD XACT_STATE_PREPARING = 0x00000002; // In the middle of preparing
static const DWORD XACT_STATE_PREPARED = 0x00000004; // Prepared, but not yet played
static const DWORD XACT_STATE_PLAYING = 0x00000008; // Playing (though could be paused)
static const DWORD XACT_STATE_STOPPING = 0x00000010; // Stopping
static const DWORD XACT_STATE_STOPPED = 0x00000020; // Stopped
static const DWORD XACT_STATE_PAUSED = 0x00000040; // Paused (Can be combined with some of the other state flags above)
static const DWORD XACT_STATE_INUSE = 0x00000080; // Object is in use (used by wavebanks and soundbanks).
static const DWORD XACT_STATE_PREPAREFAILED = 0x80000000; // Object preparation failed.
//------------------------------------------------------------------------------
// XACT Parameters
//------------------------------------------------------------------------------
#define XACT_FLAG_GLOBAL_SETTINGS_MANAGEDATA XACT_FLAG_MANAGEDATA
// -----------------------------------------------------------------------------
// File IO Callbacks
// -----------------------------------------------------------------------------
typedef BOOL (__stdcall * XACT_READFILE_CALLBACK)(__in HANDLE hFile, __out_bcount(nNumberOfBytesToRead) LPVOID lpBuffer, DWORD nNumberOfBytesToRead, __out LPDWORD lpNumberOfBytesRead, __inout LPOVERLAPPED lpOverlapped);
typedef BOOL (__stdcall * XACT_GETOVERLAPPEDRESULT_CALLBACK)(__in HANDLE hFile, __inout LPOVERLAPPED lpOverlapped, __out LPDWORD lpNumberOfBytesTransferred, BOOL bWait);
typedef struct XACT_FILEIO_CALLBACKS
{
XACT_READFILE_CALLBACK readFileCallback;
XACT_GETOVERLAPPEDRESULT_CALLBACK getOverlappedResultCallback;
} XACT_FILEIO_CALLBACKS, *PXACT_FILEIO_CALLBACKS;
typedef const XACT_FILEIO_CALLBACKS *PCXACT_FILEIO_CALLBACKS;
// -----------------------------------------------------------------------------
// Notification Callback
// -----------------------------------------------------------------------------
typedef void (__stdcall * XACT_NOTIFICATION_CALLBACK)(__in const XACT_NOTIFICATION* pNotification);
#define XACT_RENDERER_ID_LENGTH 0xff // Maximum number of characters allowed in the renderer ID
#define XACT_RENDERER_NAME_LENGTH 0xff // Maximum number of characters allowed in the renderer display name.
// -----------------------------------------------------------------------------
// Renderer Details
// -----------------------------------------------------------------------------
typedef struct XACT_RENDERER_DETAILS
{
WCHAR rendererID[XACT_RENDERER_ID_LENGTH]; // The string ID for the rendering device.
WCHAR displayName[XACT_RENDERER_NAME_LENGTH]; // A friendly name suitable for display to a human.
BOOL defaultDevice; // Set to TRUE if this device is the primary audio device on the system.
} XACT_RENDERER_DETAILS, *LPXACT_RENDERER_DETAILS;
// -----------------------------------------------------------------------------
// Engine Look-Ahead Time
// -----------------------------------------------------------------------------
#define XACT_ENGINE_LOOKAHEAD_DEFAULT 250 // Default look-ahead time of 250ms can be used during XACT engine initialization.
// -----------------------------------------------------------------------------
// Runtime (engine) parameters
// -----------------------------------------------------------------------------
typedef struct XACT_RUNTIME_PARAMETERS
{
DWORD lookAheadTime; // Time in ms
void* pGlobalSettingsBuffer; // Buffer containing the global settings file
DWORD globalSettingsBufferSize; // Size of global settings buffer
DWORD globalSettingsFlags; // Flags for global settings
DWORD globalSettingsAllocAttributes; // Global settings buffer allocation attributes (see XMemAlloc)
XACT_FILEIO_CALLBACKS fileIOCallbacks; // File I/O callbacks
XACT_NOTIFICATION_CALLBACK fnNotificationCallback; // Callback that receives notifications.
PWSTR pRendererID; // Ptr to the ID for the audio renderer the engine should connect to.
IXAudio2* pXAudio2; // XAudio2 object to be used by the engine (NULL if one needs to be created)
IXAudio2MasteringVoice* pMasteringVoice; // Mastering voice to be used by the engine, if pXAudio2 is not NULL.
} XACT_RUNTIME_PARAMETERS, *LPXACT_RUNTIME_PARAMETERS;
typedef const XACT_RUNTIME_PARAMETERS *LPCXACT_RUNTIME_PARAMETERS;
//------------------------------------------------------------------------------
// Streaming Parameters
//------------------------------------------------------------------------------
typedef struct XACT_STREAMING_PARAMETERS
{
HANDLE file; // File handle associated with wavebank data
DWORD offset; // Offset within file of wavebank header (must be sector aligned)
DWORD flags; // Flags (none currently)
WORD packetSize; // 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)
} XACT_WAVEBANK_STREAMING_PARAMETERS, *LPXACT_WAVEBANK_STREAMING_PARAMETERS, XACT_STREAMING_PARAMETERS, *LPXACT_STREAMING_PARAMETERS;
typedef const XACT_STREAMING_PARAMETERS *LPCXACT_STREAMING_PARAMETERS;
typedef const XACT_WAVEBANK_STREAMING_PARAMETERS *LPCXACT_WAVEBANK_STREAMING_PARAMETERS;
// Structure used to report cue properties back to the client.
typedef struct XACT_CUE_PROPERTIES
{
CHAR friendlyName[XACT_CUE_NAME_LENGTH]; // Empty if the soundbank doesn't contain any friendly names
BOOL interactive; // TRUE if an IA cue; FALSE otherwise
XACTINDEX iaVariableIndex; // Only valid for IA cues; XACTINDEX_INVALID otherwise
XACTINDEX numVariations; // Number of variations in the cue
XACTINSTANCELIMIT maxInstances; // Number of maximum instances for this cue
XACTINSTANCELIMIT currentInstances; // Current active instances of this cue
} XACT_CUE_PROPERTIES, *LPXACT_CUE_PROPERTIES;
// Strucutre used to return the track properties.
typedef struct XACT_TRACK_PROPERTIES
{
XACTTIME duration; // Duration of the track in ms
XACTINDEX numVariations; // Number of wave variations in the track
XACTCHANNEL numChannels; // Number of channels for the active wave variation on this track
XACTINDEX waveVariation; // Index of the active wave variation
XACTLOOPCOUNT loopCount; // Current loop count on this track
} XACT_TRACK_PROPERTIES, *LPXACT_TRACK_PROPERTIES;
// Structure used to return the properties of a variation.
typedef struct XACT_VARIATION_PROPERTIES
{
XACTINDEX index; // Index of the variation in the cue's variation list
XACTVARIATIONWEIGHT weight; // Weight for the active variation. Valid only for complex cues
XACTVARIABLEVALUE iaVariableMin; // Valid only for IA cues
XACTVARIABLEVALUE iaVariableMax; // Valid only for IA cues
BOOL linger; // Valid only for IA cues
} XACT_VARIATION_PROPERTIES, *LPXACT_VARIATION_PROPERTIES;
// Structure used to return the properties of the sound referenced by a variation.
typedef struct XACT_SOUND_PROPERTIES
{
XACTCATEGORY category; // Category this sound belongs to
BYTE priority; // Priority of this variation
XACTPITCH pitch; // Current pitch set on the active variation
XACTVOLUME volume; // Current volume set on the active variation
XACTINDEX numTracks; // Number of tracks in the active variation
XACT_TRACK_PROPERTIES arrTrackProperties[1]; // Array of active track properties (has numTracks number of elements)
} XACT_SOUND_PROPERTIES, *LPXACT_SOUND_PROPERTIES;
// Structure used to return the properties of the active variation and the sound referenced.
typedef struct XACT_SOUND_VARIATION_PROPERTIES
{
XACT_VARIATION_PROPERTIES variationProperties;// Properties for this variation
XACT_SOUND_PROPERTIES soundProperties; // Proeprties for the sound referenced by this variation
} XACT_SOUND_VARIATION_PROPERTIES, *LPXACT_SOUND_VARIATION_PROPERTIES;
// Structure used to return the properties of an active cue instance.
typedef struct XACT_CUE_INSTANCE_PROPERTIES
{
DWORD allocAttributes; // Buffer allocation attributes (see XMemAlloc)
XACT_CUE_PROPERTIES cueProperties; // Properties of the cue that are shared by all instances.
XACT_SOUND_VARIATION_PROPERTIES activeVariationProperties; // Properties if the currently active variation.
} XACT_CUE_INSTANCE_PROPERTIES, *LPXACT_CUE_INSTANCE_PROPERTIES;
// Structure used to return the common wave properties.
typedef struct XACT_WAVE_PROPERTIES
{
char friendlyName[WAVEBANK_ENTRYNAME_LENGTH]; // Friendly name for the wave; empty if the wavebank doesn't contain friendly names.
WAVEBANKMINIWAVEFORMAT format; // Format for the wave.
DWORD durationInSamples; // Duration of the wave in units of one sample
WAVEBANKSAMPLEREGION loopRegion; // Loop region defined in samples.
BOOL streaming; // Set to TRUE if the wave is streaming; FALSE otherwise.
} XACT_WAVE_PROPERTIES, *LPXACT_WAVE_PROPERTIES;
typedef const XACT_WAVE_PROPERTIES* LPCXACT_WAVE_PROPERTIES;
// Structure used to return the properties specific to a wave instance.
typedef struct XACT_WAVE_INSTANCE_PROPERTIES
{
XACT_WAVE_PROPERTIES properties; // Static properties common to all the wave instances.
BOOL backgroundMusic; // Set to TRUE if the wave is tagged as background music; FALSE otherwise.
} XACT_WAVE_INSTANCE_PROPERTIES, *LPXACT_WAVE_INSTANCE_PROPERTIES;
typedef const XACT_WAVE_INSTANCE_PROPERTIES* LPCXACT_WAVE_INSTANCE_PROPERTIES;
//------------------------------------------------------------------------------
// Channel Mapping / Speaker Panning
//------------------------------------------------------------------------------
typedef struct XACTCHANNELMAPENTRY
{
XACTCHANNEL InputChannel;
XACTCHANNEL OutputChannel;
XACTVOLUME Volume;
} XACTCHANNELMAPENTRY, *LPXACTCHANNELMAPENTRY;
typedef const XACTCHANNELMAPENTRY *LPCXACTCHANNELMAPENTRY;
typedef struct XACTCHANNELMAP
{
XACTCHANNEL EntryCount;
XACTCHANNELMAPENTRY* paEntries;
} XACTCHANNELMAP, *LPXACTCHANNELMAP;
typedef const XACTCHANNELMAP *LPCXACTCHANNELMAP;
typedef struct XACTCHANNELVOLUMEENTRY
{
XACTCHANNEL EntryIndex;
XACTVOLUME Volume;
} XACTCHANNELVOLUMEENTRY, *LPXACTCHANNELVOLUMEENTRY;
typedef const XACTCHANNELVOLUMEENTRY *LPCXACTCHANNELVOLUMEENTRY;
typedef struct XACTCHANNELVOLUME
{
XACTCHANNEL EntryCount;
XACTCHANNELVOLUMEENTRY* paEntries;
} XACTCHANNELVOLUME, *LPXACTCHANNELVOLUME;
typedef const XACTCHANNELVOLUME *LPCXACTCHANNELVOLUME;
//------------------------------------------------------------------------------
// Notifications
//------------------------------------------------------------------------------
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPREPARED = 1; // None, SoundBank, SoundBank & cue index, cue instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPLAY = 2; // None, SoundBank, SoundBank & cue index, cue instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUESTOP = 3; // None, SoundBank, SoundBank & cue index, cue instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEDESTROYED = 4; // None, SoundBank, SoundBank & cue index, cue instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MARKER = 5; // None, SoundBank, SoundBank & cue index, cue instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6; // None, SoundBank
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7; // None, WaveBank
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8; // None, SoundBank, SoundBank & cue index, cue instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9; // None
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUICONNECTED = 10; // None
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11; // None
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPREPARED = 12; // None, WaveBank & wave index, wave instance.
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPLAY = 13; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVESTOP = 14; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVELOOPED = 15; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEDESTROYED = 16; // None, WaveBank & wave index, wave instance.
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17; // None, WaveBank
static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18; // None, WaveBank
static const BYTE XACT_FLAG_NOTIFICATION_PERSIST = 0x01;
// Pack the notification structures
#pragma pack(push, 1)
// Notification description used for registering, un-registering and flushing notifications
typedef struct XACT_NOTIFICATION_DESCRIPTION
{
XACTNOTIFICATIONTYPE type; // Notification type
BYTE flags; // Flags
IXACT3SoundBank* pSoundBank; // SoundBank instance
IXACT3WaveBank* pWaveBank; // WaveBank instance
IXACT3Cue* pCue; // Cue instance
IXACT3Wave* pWave; // Wave instance
XACTINDEX cueIndex; // Cue index
XACTINDEX waveIndex; // Wave index
PVOID pvContext; // User context (optional)
} XACT_NOTIFICATION_DESCRIPTION, *LPXACT_NOTIFICATION_DESCRIPTION;
typedef const XACT_NOTIFICATION_DESCRIPTION *LPCXACT_NOTIFICATION_DESCRIPTION;
// Notification structure for all XACTNOTIFICATIONTYPE_CUE* notifications
typedef struct XACT_NOTIFICATION_CUE
{
XACTINDEX cueIndex; // Cue index
IXACT3SoundBank* pSoundBank; // SoundBank instance
IXACT3Cue* pCue; // Cue instance
} XACT_NOTIFICATION_CUE, *LPXACT_NOTIFICATION_CUE;
typedef const XACT_NOTIFICATION_CUE *LPCXACT_NOTIFICATION_CUE;
// Notification structure for all XACTNOTIFICATIONTYPE_MARKER* notifications
typedef struct XACT_NOTIFICATION_MARKER
{
XACTINDEX cueIndex; // Cue index
IXACT3SoundBank* pSoundBank; // SoundBank instance
IXACT3Cue* pCue; // Cue instance
DWORD marker; // Marker value
} XACT_NOTIFICATION_MARKER, *LPXACT_NOTIFICATION_MARKER;
typedef const XACT_NOTIFICATION_MARKER *LPCXACT_NOTIFICATION_MARKER;
// Notification structure for all XACTNOTIFICATIONTYPE_SOUNDBANK* notifications
typedef struct XACT_NOTIFICATION_SOUNDBANK
{
IXACT3SoundBank* pSoundBank; // SoundBank instance
} XACT_NOTIFICATION_SOUNDBANK, *LPXACT_NOTIFICATION_SOUNDBANK;
typedef const XACT_NOTIFICATION_SOUNDBANK *LPCXACT_NOTIFICATION_SOUNDBANK;
// Notification structure for all XACTNOTIFICATIONTYPE_WAVEBANK* notifications
typedef struct XACT_NOTIFICATION_WAVEBANK
{
IXACT3WaveBank* pWaveBank; // WaveBank instance
} XACT_NOTIFICATION_WAVEBANK, *LPXACT_NOTIFICATION_WAVEBANK;
typedef const XACT_NOTIFICATION_WAVEBANK *LPCXACT_NOTIFICATION_WAVEBANK;
// Notification structure for all XACTNOTIFICATIONTYPE_*VARIABLE* notifications
typedef struct XACT_NOTIFICATION_VARIABLE
{
XACTINDEX cueIndex; // Cue index
IXACT3SoundBank* pSoundBank; // SoundBank instance
IXACT3Cue* pCue; // Cue instance
XACTVARIABLEINDEX variableIndex; // Variable index
XACTVARIABLEVALUE variableValue; // Variable value
BOOL local; // TRUE if a local variable
} XACT_NOTIFICATION_VARIABLE, *LPXACT_NOTIFICATION_VARIABLE;
typedef const XACT_NOTIFICATION_VARIABLE *LPCXACT_NOTIFICATION_VARIABLE;
// Notification structure for all XACTNOTIFICATIONTYPE_GUI* notifications
typedef struct XACT_NOTIFICATION_GUI
{
DWORD reserved; // Reserved
} XACT_NOTIFICATION_GUI, *LPXACT_NOTIFICATION_GUI;
typedef const XACT_NOTIFICATION_GUI *LPCXACT_NOTIFICATION_GUI;
// Notification structure for all XACTNOTIFICATIONTYPE_WAVE* notifications
typedef struct XACT_NOTIFICATION_WAVE
{
IXACT3WaveBank* pWaveBank; // WaveBank
XACTINDEX waveIndex; // Wave index
XACTINDEX cueIndex; // Cue index
IXACT3SoundBank* pSoundBank; // SoundBank instance
IXACT3Cue* pCue; // Cue instance
IXACT3Wave* pWave; // Wave instance
} XACT_NOTIFICATION_WAVE, *LPXACT_NOTIFICATION_WAVE;
typedef const XACT_NOTIFICATION_WAVE *LPCXACT_NOTIFICATION_WAVE;
// General notification structure
typedef struct XACT_NOTIFICATION
{
XACTNOTIFICATIONTYPE type; // Notification type
LONG timeStamp; // Timestamp of notification (milliseconds)
PVOID pvContext; // User context (optional)
union
{
XACT_NOTIFICATION_CUE cue; // XACTNOTIFICATIONTYPE_CUE*
XACT_NOTIFICATION_MARKER marker; // XACTNOTIFICATIONTYPE_MARKER*
XACT_NOTIFICATION_SOUNDBANK soundBank; // XACTNOTIFICATIONTYPE_SOUNDBANK*
XACT_NOTIFICATION_WAVEBANK waveBank; // XACTNOTIFICATIONTYPE_WAVEBANK*
XACT_NOTIFICATION_VARIABLE variable; // XACTNOTIFICATIONTYPE_VARIABLE*
XACT_NOTIFICATION_GUI gui; // XACTNOTIFICATIONTYPE_GUI*
XACT_NOTIFICATION_WAVE wave; // XACTNOTIFICATIONTYPE_WAVE*
};
} XACT_NOTIFICATION, *LPXACT_NOTIFICATION;
typedef const XACT_NOTIFICATION *LPCXACT_NOTIFICATION;
#pragma pack(pop)
//------------------------------------------------------------------------------
// IXACT3SoundBank
//------------------------------------------------------------------------------
#define XACT_FLAG_SOUNDBANK_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE
#define XACT_SOUNDBANKSTATE_INUSE XACT_STATE_INUSE
STDAPI_(XACTINDEX) IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName);
STDAPI IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues);
STDAPI IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties);
STDAPI IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue);
STDAPI IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue);
STDAPI IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags);
STDAPI IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank);
STDAPI IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState);
#undef INTERFACE
#define INTERFACE IXACT3SoundBank
DECLARE_INTERFACE(IXACT3SoundBank)
{
STDMETHOD_(XACTINDEX, GetCueIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
STDMETHOD(GetNumCues)(THIS_ __out XACTINDEX* pnNumCues) PURE;
STDMETHOD(GetCueProperties)(THIS_ XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) PURE;
STDMETHOD(Prepare)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) PURE;
STDMETHOD(Play)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) PURE;
STDMETHOD(Stop)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags) PURE;
STDMETHOD(Destroy)(THIS) PURE;
STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
};
#ifdef __cplusplus
__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank)
{
return pSoundBank->Destroy();
}
__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName)
{
return pSoundBank->GetCueIndex(szFriendlyName);
}
__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues)
{
return pSoundBank->GetNumCues(pnNumCues);
}
__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties)
{
return pSoundBank->GetCueProperties(nCueIndex, pProperties);
}
__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue)
{
return pSoundBank->Prepare(nCueIndex, dwFlags, timeOffset, ppCue);
}
__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue)
{
return pSoundBank->Play(nCueIndex, dwFlags, timeOffset, ppCue);
}
__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags)
{
return pSoundBank->Stop(nCueIndex, dwFlags);
}
__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState)
{
return pSoundBank->GetState(pdwState);
}
#else // __cplusplus
__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank)
{
return pSoundBank->lpVtbl->Destroy(pSoundBank);
}
__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName)
{
return pSoundBank->lpVtbl->GetCueIndex(pSoundBank, szFriendlyName);
}
__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues)
{
return pSoundBank->lpVtbl->GetNumCues(pSoundBank, pnNumCues);
}
__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties)
{
return pSoundBank->lpVtbl->GetCueProperties(pSoundBank, nCueIndex, pProperties);
}
__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue)
{
return pSoundBank->lpVtbl->Prepare(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue);
}
__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue)
{
return pSoundBank->lpVtbl->Play(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue);
}
__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags)
{
return pSoundBank->lpVtbl->Stop(pSoundBank, nCueIndex, dwFlags);
}
__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState)
{
return pSoundBank->lpVtbl->GetState(pSoundBank, pdwState);
}
#endif // __cplusplus
//------------------------------------------------------------------------------
// IXACT3WaveBank
//------------------------------------------------------------------------------
#define XACT_WAVEBANKSTATE_INUSE XACT_STATE_INUSE // Currently in-use
#define XACT_WAVEBANKSTATE_PREPARED XACT_STATE_PREPARED // Prepared
#define XACT_WAVEBANKSTATE_PREPAREFAILED XACT_STATE_PREPAREFAILED // Prepare failed.
STDAPI IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank);
STDAPI IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState);
STDAPI IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves);
STDAPI_(XACTINDEX) IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName);
STDAPI IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties);
STDAPI IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
STDAPI IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
STDAPI IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags);
#undef INTERFACE
#define INTERFACE IXACT3WaveBank
DECLARE_INTERFACE(IXACT3WaveBank)
{
STDMETHOD(Destroy)(THIS) PURE;
STDMETHOD(GetNumWaves)(THIS_ __out XACTINDEX* pnNumWaves) PURE;
STDMETHOD_(XACTINDEX, GetWaveIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
STDMETHOD(GetWaveProperties)(THIS_ XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) PURE;
STDMETHOD(Prepare)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
STDMETHOD(Play)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
STDMETHOD(Stop)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags) PURE;
STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
};
#ifdef __cplusplus
__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank)
{
return pWaveBank->Destroy();
}
__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves)
{
return pWaveBank->GetNumWaves(pnNumWaves);
}
__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName)
{
return pWaveBank->GetWaveIndex(szFriendlyName);
}
__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties)
{
return pWaveBank->GetWaveProperties(nWaveIndex, pWaveProperties);
}
__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
{
return pWaveBank->Prepare(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
}
__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
{
return pWaveBank->Play(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
}
__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags)
{
return pWaveBank->Stop(nWaveIndex, dwFlags);
}
__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState)
{
return pWaveBank->GetState(pdwState);
}
#else // __cplusplus
__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank)
{
return pWaveBank->lpVtbl->Destroy(pWaveBank);
}
__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves)
{
return pWaveBank->lpVtbl->GetNumWaves(pWaveBank, pnNumWaves);
}
__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName)
{
return pWaveBank->lpVtbl->GetWaveIndex(pWaveBank, szFriendlyName);
}
__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties)
{
return pWaveBank->lpVtbl->GetWaveProperties(pWaveBank, nWaveIndex, pWaveProperties);
}
__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
{
return pWaveBank->lpVtbl->Prepare(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
}
__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
{
return pWaveBank->lpVtbl->Play(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
}
__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags)
{
return pWaveBank->lpVtbl->Stop(pWaveBank, nWaveIndex, dwFlags);
}
__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState)
{
return pWaveBank->lpVtbl->GetState(pWaveBank, pdwState);
}
#endif // __cplusplus
//------------------------------------------------------------------------------
// IXACT3Wave
//------------------------------------------------------------------------------
STDAPI IXACT3Wave_Destroy(__in IXACT3Wave* pWave);
STDAPI IXACT3Wave_Play(__in IXACT3Wave* pWave);
STDAPI IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags);
STDAPI IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause);
STDAPI IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState);
STDAPI IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch);
STDAPI IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume);
STDAPI IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients);
STDAPI IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties);
#undef INTERFACE
#define INTERFACE IXACT3Wave
DECLARE_INTERFACE(IXACT3Wave)
{
STDMETHOD(Destroy)(THIS) PURE;
STDMETHOD(Play)(THIS) PURE;
STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE;
STDMETHOD(Pause)(THIS_ BOOL fPause) PURE;
STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
STDMETHOD(SetPitch)(THIS_ XACTPITCH pitch) PURE;
STDMETHOD(SetVolume)(THIS_ XACTVOLUME volume) PURE;
STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE;
STDMETHOD(GetProperties)(THIS_ __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) PURE;
};
#ifdef __cplusplus
__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave)
{
return pWave->Destroy();
}
__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave)
{
return pWave->Play();
}
__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags)
{
return pWave->Stop(dwFlags);
}
__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause)
{
return pWave->Pause(fPause);
}
__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState)
{
return pWave->GetState(pdwState);
}
__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch)
{
return pWave->SetPitch(pitch);
}
__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume)
{
return pWave->SetVolume(volume);
}
__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
{
return pWave->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
}
__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties)
{
return pWave->GetProperties(pProperties);
}
#else // __cplusplus
__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave)
{
return pWave->lpVtbl->Destroy(pWave);
}
__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave)
{
return pWave->lpVtbl->Play(pWave);
}
__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags)
{
return pWave->lpVtbl->Stop(pWave, dwFlags);
}
__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause)
{
return pWave->lpVtbl->Pause(pWave, fPause);
}
__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState)
{
return pWave->lpVtbl->GetState(pWave, pdwState);
}
__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch)
{
return pWave->lpVtbl->SetPitch(pWave, pitch);
}
__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume)
{
return pWave->lpVtbl->SetVolume(pWave, volume);
}
__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
{
return pWave->lpVtbl->SetMatrixCoefficients(pWave, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
}
__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties)
{
return pWave->lpVtbl->GetProperties(pWave, pProperties);
}
#endif // __cplusplus
//------------------------------------------------------------------------------
// IXACT3Cue
//------------------------------------------------------------------------------
// Cue Flags
#define XACT_FLAG_CUE_STOP_RELEASE XACT_FLAG_STOP_RELEASE
#define XACT_FLAG_CUE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE
// Mutually exclusive states
#define XACT_CUESTATE_CREATED XACT_STATE_CREATED // Created, but nothing else
#define XACT_CUESTATE_PREPARING XACT_STATE_PREPARING // In the middle of preparing
#define XACT_CUESTATE_PREPARED XACT_STATE_PREPARED // Prepared, but not yet played
#define XACT_CUESTATE_PLAYING XACT_STATE_PLAYING // Playing (though could be paused)
#define XACT_CUESTATE_STOPPING XACT_STATE_STOPPING // Stopping
#define XACT_CUESTATE_STOPPED XACT_STATE_STOPPED // Stopped
#define XACT_CUESTATE_PAUSED XACT_STATE_PAUSED // Paused (can be combined with other states)
STDAPI IXACT3Cue_Destroy(__in IXACT3Cue* pCue);
STDAPI IXACT3Cue_Play(__in IXACT3Cue* pCue);
STDAPI IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags);
STDAPI IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState);
STDAPI IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue*, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients);
STDAPI_(XACTVARIABLEINDEX) IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName);
STDAPI IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue);
STDAPI IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue);
STDAPI IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause);
STDAPI IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties);
STDAPI IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList);
STDAPI IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix);
#undef INTERFACE
#define INTERFACE IXACT3Cue
DECLARE_INTERFACE(IXACT3Cue)
{
STDMETHOD(Play)(THIS) PURE;
STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE;
STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
STDMETHOD(Destroy)(THIS) PURE;
STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE;
STDMETHOD_(XACTVARIABLEINDEX, GetVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
STDMETHOD(SetVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE;
STDMETHOD(GetVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE;
STDMETHOD(Pause)(THIS_ BOOL fPause) PURE;
STDMETHOD(GetProperties)(THIS_ __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) PURE;
STDMETHOD(SetOutputVoices)(THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE;
STDMETHOD(SetOutputVoiceMatrix)(THIS_ __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) PURE;
};
#ifdef __cplusplus
__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue)
{
return pCue->Play();
}
__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags)
{
return pCue->Stop(dwFlags);
}
__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState)
{
return pCue->GetState(pdwState);
}
__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue)
{
return pCue->Destroy();
}
__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
{
return pCue->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
}
__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName)
{
return pCue->GetVariableIndex(szFriendlyName);
}
__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue)
{
return pCue->SetVariable(nIndex, nValue);
}
__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue)
{
return pCue->GetVariable(nIndex, pnValue);
}
__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause)
{
return pCue->Pause(fPause);
}