Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/faudio/include/FACT.h
8586 views
1
/* FAudio - XAudio Reimplementation for FNA
2
*
3
* Copyright (c) 2011-2024 Ethan Lee, Luigi Auriemma, and the MonoGame Team
4
*
5
* This software is provided 'as-is', without any express or implied warranty.
6
* In no event will the authors be held liable for any damages arising from
7
* the use of this software.
8
*
9
* Permission is granted to anyone to use this software for any purpose,
10
* including commercial applications, and to alter it and redistribute it
11
* freely, subject to the following restrictions:
12
*
13
* 1. The origin of this software must not be misrepresented; you must not
14
* claim that you wrote the original software. If you use this software in a
15
* product, an acknowledgment in the product documentation would be
16
* appreciated but is not required.
17
*
18
* 2. Altered source versions must be plainly marked as such, and must not be
19
* misrepresented as being the original software.
20
*
21
* 3. This notice may not be removed or altered from any source distribution.
22
*
23
* Ethan "flibitijibibo" Lee <[email protected]>
24
*
25
*/
26
27
/* This file has no documentation since you are expected to already know how
28
* XACT works if you are still using these APIs!
29
*/
30
31
#ifndef FACT_H
32
#define FACT_H
33
34
#include "FAudio.h"
35
36
#define FACTAPI FAUDIOAPI
37
#ifdef _WIN32
38
#define FACTCALL __stdcall
39
#else
40
#define FACTCALL
41
#endif
42
43
#ifdef __cplusplus
44
extern "C" {
45
#endif /* __cplusplus */
46
47
#define FACTENGINE_E_NONOTIFICATIONCALLBACK 0x8ac70004
48
#define FACTENGINE_E_INVALIDUSAGE 0x8ac70006
49
#define FACTENGINE_E_INVALIDDATA 0x8ac70007
50
#define FACTENGINE_E_INSTANCELIMITFAILTOPLAY 0x8ac70008
51
#define FACTENGINE_E_INVALIDVARIABLEINDEX 0x8ac7000a
52
#define FACTENGINE_E_INVALIDCUEINDEX 0x8ac7000c
53
54
/* Type Declarations */
55
56
typedef struct FACTAudioEngine FACTAudioEngine;
57
typedef struct FACTSoundBank FACTSoundBank;
58
typedef struct FACTWaveBank FACTWaveBank;
59
typedef struct FACTWave FACTWave;
60
typedef struct FACTCue FACTCue;
61
typedef struct FACTNotification FACTNotification;
62
63
typedef struct FACTRendererDetails
64
{
65
int16_t rendererID[0xFF]; /* Win32 wchar_t */
66
int16_t displayName[0xFF]; /* Win32 wchar_t */
67
int32_t defaultDevice;
68
} FACTRendererDetails;
69
70
typedef struct FACTOverlapped
71
{
72
void *Internal; /* ULONG_PTR */
73
void *InternalHigh; /* ULONG_PTR */
74
FAUDIONAMELESS union
75
{
76
FAUDIONAMELESS struct
77
{
78
uint32_t Offset;
79
uint32_t OffsetHigh;
80
};
81
void *Pointer;
82
};
83
void *hEvent;
84
} FACTOverlapped;
85
86
typedef int32_t (FACTCALL * FACTReadFileCallback)(
87
void *hFile,
88
void *buffer,
89
uint32_t nNumberOfBytesToRead,
90
uint32_t *lpNumberOfBytesRead,
91
FACTOverlapped *lpOverlapped
92
);
93
94
typedef int32_t (FACTCALL * FACTGetOverlappedResultCallback)(
95
void *hFile,
96
FACTOverlapped *lpOverlapped,
97
uint32_t *lpNumberOfBytesTransferred,
98
int32_t bWait
99
);
100
101
typedef struct FACTFileIOCallbacks
102
{
103
FACTReadFileCallback readFileCallback;
104
FACTGetOverlappedResultCallback getOverlappedResultCallback;
105
} FACTFileIOCallbacks;
106
107
typedef void (FACTCALL * FACTNotificationCallback)(
108
const FACTNotification *pNotification
109
);
110
111
/* FIXME: ABI bug! This should be pack(1) explicitly. Do not memcpy this! */
112
typedef struct FACTRuntimeParameters
113
{
114
uint32_t lookAheadTime;
115
void *pGlobalSettingsBuffer;
116
uint32_t globalSettingsBufferSize;
117
uint32_t globalSettingsFlags;
118
uint32_t globalSettingsAllocAttributes;
119
FACTFileIOCallbacks fileIOCallbacks;
120
FACTNotificationCallback fnNotificationCallback;
121
int16_t *pRendererID; /* Win32 wchar_t* */
122
FAudio *pXAudio2;
123
FAudioMasteringVoice *pMasteringVoice;
124
} FACTRuntimeParameters;
125
126
typedef struct FACTStreamingParameters
127
{
128
void *file;
129
uint32_t offset;
130
uint32_t flags;
131
uint16_t packetSize; /* Measured in DVD sectors, or 2048 bytes */
132
} FACTStreamingParameters;
133
134
#define FACT_WAVEBANKMINIFORMAT_TAG_PCM 0x0
135
#define FACT_WAVEBANKMINIFORMAT_TAG_XMA 0x1
136
#define FACT_WAVEBANKMINIFORMAT_TAG_ADPCM 0x2
137
#define FACT_WAVEBANKMINIFORMAT_TAG_WMA 0x3
138
139
#define FACT_WAVEBANK_TYPE_BUFFER 0x00000000
140
#define FACT_WAVEBANK_TYPE_STREAMING 0x00000001
141
#define FACT_WAVEBANK_TYPE_MASK 0x00000001
142
143
#define FACT_WAVEBANK_FLAGS_ENTRYNAMES 0x00010000
144
#define FACT_WAVEBANK_FLAGS_COMPACT 0x00020000
145
#define FACT_WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000
146
#define FACT_WAVEBANK_FLAGS_SEEKTABLES 0x00080000
147
#define FACT_WAVEBANK_FLAGS_MASK 0x000F0000
148
149
typedef enum FACTWaveBankSegIdx
150
{
151
FACT_WAVEBANK_SEGIDX_BANKDATA = 0,
152
FACT_WAVEBANK_SEGIDX_ENTRYMETADATA,
153
FACT_WAVEBANK_SEGIDX_SEEKTABLES,
154
FACT_WAVEBANK_SEGIDX_ENTRYNAMES,
155
FACT_WAVEBANK_SEGIDX_ENTRYWAVEDATA,
156
FACT_WAVEBANK_SEGIDX_COUNT
157
} FACTWaveBankSegIdx;
158
159
#pragma pack(push, 1)
160
161
typedef struct FACTWaveBankRegion
162
{
163
uint32_t dwOffset;
164
uint32_t dwLength;
165
} FACTWaveBankRegion;
166
167
typedef struct FACTWaveBankSampleRegion
168
{
169
uint32_t dwStartSample;
170
uint32_t dwTotalSamples;
171
} FACTWaveBankSampleRegion;
172
173
typedef struct FACTWaveBankHeader
174
{
175
uint32_t dwSignature;
176
uint32_t dwVersion;
177
uint32_t dwHeaderVersion;
178
FACTWaveBankRegion Segments[FACT_WAVEBANK_SEGIDX_COUNT];
179
} FACTWaveBankHeader;
180
181
typedef union FACTWaveBankMiniWaveFormat
182
{
183
FAUDIONAMELESS struct
184
{
185
uint32_t wFormatTag : 2;
186
uint32_t nChannels : 3;
187
uint32_t nSamplesPerSec : 18;
188
uint32_t wBlockAlign : 8;
189
uint32_t wBitsPerSample : 1;
190
};
191
uint32_t dwValue;
192
} FACTWaveBankMiniWaveFormat;
193
194
typedef struct FACTWaveBankEntry
195
{
196
FAUDIONAMELESS union
197
{
198
FAUDIONAMELESS struct
199
{
200
uint32_t dwFlags : 4;
201
uint32_t Duration : 28;
202
};
203
uint32_t dwFlagsAndDuration;
204
};
205
FACTWaveBankMiniWaveFormat Format;
206
FACTWaveBankRegion PlayRegion;
207
FACTWaveBankSampleRegion LoopRegion;
208
} FACTWaveBankEntry;
209
210
typedef struct FACTWaveBankEntryCompact
211
{
212
uint32_t dwOffset : 21;
213
uint32_t dwLengthDeviation : 11;
214
} FACTWaveBankEntryCompact;
215
216
typedef struct FACTWaveBankData
217
{
218
uint32_t dwFlags;
219
uint32_t dwEntryCount;
220
char szBankName[64];
221
uint32_t dwEntryMetaDataElementSize;
222
uint32_t dwEntryNameElementSize;
223
uint32_t dwAlignment;
224
FACTWaveBankMiniWaveFormat CompactFormat;
225
uint64_t BuildTime;
226
} FACTWaveBankData;
227
228
#pragma pack(pop)
229
230
typedef struct FACTWaveProperties
231
{
232
char friendlyName[64];
233
FACTWaveBankMiniWaveFormat format;
234
uint32_t durationInSamples;
235
FACTWaveBankSampleRegion loopRegion;
236
int32_t streaming;
237
} FACTWaveProperties;
238
239
typedef struct FACTWaveInstanceProperties
240
{
241
FACTWaveProperties properties;
242
int32_t backgroundMusic;
243
} FACTWaveInstanceProperties;
244
245
typedef struct FACTCueProperties
246
{
247
char friendlyName[0xFF];
248
int32_t interactive;
249
uint16_t iaVariableIndex;
250
uint16_t numVariations;
251
uint8_t maxInstances;
252
uint8_t currentInstances;
253
} FACTCueProperties;
254
255
typedef struct FACTTrackProperties
256
{
257
uint32_t duration;
258
uint16_t numVariations;
259
uint8_t numChannels;
260
uint16_t waveVariation;
261
uint8_t loopCount;
262
} FACTTrackProperties;
263
264
typedef struct FACTVariationProperties
265
{
266
uint16_t index;
267
uint8_t weight;
268
float iaVariableMin;
269
float iaVariableMax;
270
int32_t linger;
271
} FACTVariationProperties;
272
273
typedef struct FACTSoundProperties
274
{
275
uint16_t category;
276
uint8_t priority;
277
int16_t pitch;
278
float volume;
279
uint16_t numTracks;
280
FACTTrackProperties arrTrackProperties[1];
281
} FACTSoundProperties;
282
283
typedef struct FACTSoundVariationProperties
284
{
285
FACTVariationProperties variationProperties;
286
FACTSoundProperties soundProperties;
287
} FACTSoundVariationProperties;
288
289
typedef struct FACTCueInstanceProperties
290
{
291
uint32_t allocAttributes;
292
FACTCueProperties cueProperties;
293
FACTSoundVariationProperties activeVariationProperties;
294
} FACTCueInstanceProperties;
295
296
#pragma pack(push, 1)
297
298
typedef struct FACTNotificationDescription
299
{
300
uint8_t type;
301
uint8_t flags;
302
FACTSoundBank *pSoundBank;
303
FACTWaveBank *pWaveBank;
304
FACTCue *pCue;
305
FACTWave *pWave;
306
uint16_t cueIndex;
307
uint16_t waveIndex;
308
void* pvContext;
309
} FACTNotificationDescription;
310
311
typedef struct FACTNotificationCue
312
{
313
uint16_t cueIndex;
314
FACTSoundBank *pSoundBank;
315
FACTCue *pCue;
316
} FACTNotificationCue;
317
318
typedef struct FACTNotificationMarker
319
{
320
uint16_t cueIndex;
321
FACTSoundBank *pSoundBank;
322
FACTCue *pCue;
323
uint32_t marker;
324
} FACTNotificationMarker;
325
326
typedef struct FACTNotificationSoundBank
327
{
328
FACTSoundBank *pSoundBank;
329
} FACTNotificationSoundBank;
330
331
typedef struct FACTNotificationWaveBank
332
{
333
FACTWaveBank *pWaveBank;
334
} FACTNotificationWaveBank;
335
336
typedef struct FACTNotificationVariable
337
{
338
uint16_t cueIndex;
339
FACTSoundBank *pSoundBank;
340
FACTCue *pCue;
341
uint16_t variableIndex;
342
float variableValue;
343
int32_t local;
344
} FACTNotificationVariable;
345
346
typedef struct FACTNotificationGUI
347
{
348
uint32_t reserved;
349
} FACTNotificationGUI;
350
351
typedef struct FACTNotificationWave
352
{
353
FACTWaveBank *pWaveBank;
354
uint16_t waveIndex;
355
uint16_t cueIndex;
356
FACTSoundBank *pSoundBank;
357
FACTCue *pCue;
358
FACTWave *pWave;
359
} FACTNotificationWave;
360
361
struct FACTNotification
362
{
363
uint8_t type;
364
int32_t timeStamp;
365
void *pvContext;
366
FAUDIONAMELESS union
367
{
368
FACTNotificationCue cue;
369
FACTNotificationMarker marker;
370
FACTNotificationSoundBank soundBank;
371
FACTNotificationWaveBank waveBank;
372
FACTNotificationVariable variable;
373
FACTNotificationGUI gui;
374
FACTNotificationWave wave;
375
};
376
};
377
378
#pragma pack(pop)
379
380
/* Constants */
381
382
#define FACT_CONTENT_VERSION 46
383
384
static const uint32_t FACT_FLAG_MANAGEDATA = 0x00000001;
385
386
static const uint32_t FACT_FLAG_STOP_RELEASE = 0x00000000;
387
static const uint32_t FACT_FLAG_STOP_IMMEDIATE = 0x00000001;
388
389
static const uint32_t FACT_FLAG_BACKGROUND_MUSIC = 0x00000002;
390
static const uint32_t FACT_FLAG_UNITS_MS = 0x00000004;
391
static const uint32_t FACT_FLAG_UNITS_SAMPLES = 0x00000008;
392
393
static const uint32_t FACT_STATE_CREATED = 0x00000001;
394
static const uint32_t FACT_STATE_PREPARING = 0x00000002;
395
static const uint32_t FACT_STATE_PREPARED = 0x00000004;
396
static const uint32_t FACT_STATE_PLAYING = 0x00000008;
397
static const uint32_t FACT_STATE_STOPPING = 0x00000010;
398
static const uint32_t FACT_STATE_STOPPED = 0x00000020;
399
static const uint32_t FACT_STATE_PAUSED = 0x00000040;
400
static const uint32_t FACT_STATE_INUSE = 0x00000080;
401
static const uint32_t FACT_STATE_PREPAREFAILED = 0x80000000;
402
403
static const int16_t FACTPITCH_MIN = -1200;
404
static const int16_t FACTPITCH_MAX = 1200;
405
static const int16_t FACTPITCH_MIN_TOTAL = -2400;
406
static const int16_t FACTPITCH_MAX_TOTAL = 2400;
407
408
static const float FACTVOLUME_MIN = 0.0f;
409
static const float FACTVOLUME_MAX = 16777216.0f;
410
411
static const uint16_t FACTINDEX_INVALID = 0xFFFF;
412
static const uint16_t FACTVARIABLEINDEX_INVALID = 0xFFFF;
413
static const uint16_t FACTCATEGORY_INVALID = 0xFFFF;
414
415
static const uint8_t FACTNOTIFICATIONTYPE_CUEPREPARED = 1;
416
static const uint8_t FACTNOTIFICATIONTYPE_CUEPLAY = 2;
417
static const uint8_t FACTNOTIFICATIONTYPE_CUESTOP = 3;
418
static const uint8_t FACTNOTIFICATIONTYPE_CUEDESTROYED = 4;
419
static const uint8_t FACTNOTIFICATIONTYPE_MARKER = 5;
420
static const uint8_t FACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6;
421
static const uint8_t FACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7;
422
static const uint8_t FACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8;
423
static const uint8_t FACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9;
424
static const uint8_t FACTNOTIFICATIONTYPE_GUICONNECTED = 10;
425
static const uint8_t FACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11;
426
static const uint8_t FACTNOTIFICATIONTYPE_WAVEPREPARED = 12;
427
static const uint8_t FACTNOTIFICATIONTYPE_WAVEPLAY = 13;
428
static const uint8_t FACTNOTIFICATIONTYPE_WAVESTOP = 14;
429
static const uint8_t FACTNOTIFICATIONTYPE_WAVELOOPED = 15;
430
static const uint8_t FACTNOTIFICATIONTYPE_WAVEDESTROYED = 16;
431
static const uint8_t FACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17;
432
static const uint8_t FACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18;
433
434
static const uint8_t FACT_FLAG_NOTIFICATION_PERSIST = 0x01;
435
436
#define FACT_ENGINE_LOOKAHEAD_DEFAULT 250
437
438
#define FACT_MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES 7
439
static const uint32_t aWMAAvgBytesPerSec[] =
440
{
441
12000,
442
24000,
443
4000,
444
6000,
445
8000,
446
20000,
447
2500
448
};
449
450
#define FACT_MAX_WMA_BLOCK_ALIGN_ENTRIES 17
451
static const uint32_t aWMABlockAlign[] =
452
{
453
929,
454
1487,
455
1280,
456
2230,
457
8917,
458
8192,
459
4459,
460
5945,
461
2304,
462
1536,
463
1485,
464
1008,
465
2731,
466
4096,
467
6827,
468
5462,
469
1280
470
};
471
472
/* AudioEngine Interface */
473
474
FACTAPI uint32_t FACTCreateEngine(
475
uint32_t dwCreationFlags,
476
FACTAudioEngine **ppEngine
477
);
478
479
/* See "extensions/CustomAllocatorEXT.txt" for more details. */
480
FACTAPI uint32_t FACTCreateEngineWithCustomAllocatorEXT(
481
uint32_t dwCreationFlags,
482
FACTAudioEngine **ppEngine,
483
FAudioMallocFunc customMalloc,
484
FAudioFreeFunc customFree,
485
FAudioReallocFunc customRealloc
486
);
487
488
FACTAPI uint32_t FACTAudioEngine_AddRef(FACTAudioEngine *pEngine);
489
490
FACTAPI uint32_t FACTAudioEngine_Release(FACTAudioEngine *pEngine);
491
492
/* FIXME: QueryInterface? Or just ignore COM garbage... -flibit */
493
494
FACTAPI uint32_t FACTAudioEngine_GetRendererCount(
495
FACTAudioEngine *pEngine,
496
uint16_t *pnRendererCount
497
);
498
499
FACTAPI uint32_t FACTAudioEngine_GetRendererDetails(
500
FACTAudioEngine *pEngine,
501
uint16_t nRendererIndex,
502
FACTRendererDetails *pRendererDetails
503
);
504
505
FACTAPI uint32_t FACTAudioEngine_GetFinalMixFormat(
506
FACTAudioEngine *pEngine,
507
FAudioWaveFormatExtensible *pFinalMixFormat
508
);
509
510
FACTAPI uint32_t FACTAudioEngine_Initialize(
511
FACTAudioEngine *pEngine,
512
const FACTRuntimeParameters *pParams
513
);
514
515
FACTAPI uint32_t FACTAudioEngine_ShutDown(FACTAudioEngine *pEngine);
516
517
FACTAPI uint32_t FACTAudioEngine_DoWork(FACTAudioEngine *pEngine);
518
519
FACTAPI uint32_t FACTAudioEngine_CreateSoundBank(
520
FACTAudioEngine *pEngine,
521
const void *pvBuffer,
522
uint32_t dwSize,
523
uint32_t dwFlags,
524
uint32_t dwAllocAttributes,
525
FACTSoundBank **ppSoundBank
526
);
527
528
FACTAPI uint32_t FACTAudioEngine_CreateInMemoryWaveBank(
529
FACTAudioEngine *pEngine,
530
const void *pvBuffer,
531
uint32_t dwSize,
532
uint32_t dwFlags,
533
uint32_t dwAllocAttributes,
534
FACTWaveBank **ppWaveBank
535
);
536
537
FACTAPI uint32_t FACTAudioEngine_CreateStreamingWaveBank(
538
FACTAudioEngine *pEngine,
539
const FACTStreamingParameters *pParms,
540
FACTWaveBank **ppWaveBank
541
);
542
543
FACTAPI uint32_t FACTAudioEngine_PrepareWave(
544
FACTAudioEngine *pEngine,
545
uint32_t dwFlags,
546
const char *szWavePath,
547
uint32_t wStreamingPacketSize,
548
uint32_t dwAlignment,
549
uint32_t dwPlayOffset,
550
uint8_t nLoopCount,
551
FACTWave **ppWave
552
);
553
554
FACTAPI uint32_t FACTAudioEngine_PrepareInMemoryWave(
555
FACTAudioEngine *pEngine,
556
uint32_t dwFlags,
557
FACTWaveBankEntry entry,
558
uint32_t *pdwSeekTable, /* Optional! */
559
uint8_t *pbWaveData,
560
uint32_t dwPlayOffset,
561
uint8_t nLoopCount,
562
FACTWave **ppWave
563
);
564
565
FACTAPI uint32_t FACTAudioEngine_PrepareStreamingWave(
566
FACTAudioEngine *pEngine,
567
uint32_t dwFlags,
568
FACTWaveBankEntry entry,
569
FACTStreamingParameters streamingParams,
570
uint32_t dwAlignment,
571
uint32_t *pdwSeekTable, /* Optional! */
572
uint8_t *pbWaveData, /* ABI bug, do not use! */
573
uint32_t dwPlayOffset,
574
uint8_t nLoopCount,
575
FACTWave **ppWave
576
);
577
578
FACTAPI uint32_t FACTAudioEngine_RegisterNotification(
579
FACTAudioEngine *pEngine,
580
const FACTNotificationDescription *pNotificationDescription
581
);
582
583
FACTAPI uint32_t FACTAudioEngine_UnRegisterNotification(
584
FACTAudioEngine *pEngine,
585
const FACTNotificationDescription *pNotificationDescription
586
);
587
588
FACTAPI uint16_t FACTAudioEngine_GetCategory(
589
FACTAudioEngine *pEngine,
590
const char *szFriendlyName
591
);
592
593
FACTAPI uint32_t FACTAudioEngine_Stop(
594
FACTAudioEngine *pEngine,
595
uint16_t nCategory,
596
uint32_t dwFlags
597
);
598
599
FACTAPI uint32_t FACTAudioEngine_SetVolume(
600
FACTAudioEngine *pEngine,
601
uint16_t nCategory,
602
float volume
603
);
604
605
FACTAPI uint32_t FACTAudioEngine_Pause(
606
FACTAudioEngine *pEngine,
607
uint16_t nCategory,
608
int32_t fPause
609
);
610
611
FACTAPI uint16_t FACTAudioEngine_GetGlobalVariableIndex(
612
FACTAudioEngine *pEngine,
613
const char *szFriendlyName
614
);
615
616
FACTAPI uint32_t FACTAudioEngine_SetGlobalVariable(
617
FACTAudioEngine *pEngine,
618
uint16_t nIndex,
619
float nValue
620
);
621
622
FACTAPI uint32_t FACTAudioEngine_GetGlobalVariable(
623
FACTAudioEngine *pEngine,
624
uint16_t nIndex,
625
float *pnValue
626
);
627
628
/* SoundBank Interface */
629
630
FACTAPI uint16_t FACTSoundBank_GetCueIndex(
631
FACTSoundBank *pSoundBank,
632
const char *szFriendlyName
633
);
634
635
FACTAPI uint32_t FACTSoundBank_GetNumCues(
636
FACTSoundBank *pSoundBank,
637
uint16_t *pnNumCues
638
);
639
640
FACTAPI uint32_t FACTSoundBank_GetCueProperties(
641
FACTSoundBank *pSoundBank,
642
uint16_t nCueIndex,
643
FACTCueProperties *pProperties
644
);
645
646
FACTAPI uint32_t FACTSoundBank_Prepare(
647
FACTSoundBank *pSoundBank,
648
uint16_t nCueIndex,
649
uint32_t dwFlags,
650
int32_t timeOffset,
651
FACTCue** ppCue
652
);
653
654
FACTAPI uint32_t FACTSoundBank_Play(
655
FACTSoundBank *pSoundBank,
656
uint16_t nCueIndex,
657
uint32_t dwFlags,
658
int32_t timeOffset,
659
FACTCue** ppCue /* Optional! */
660
);
661
662
#ifndef F3DAUDIO_DSP_SETTINGS_DECL
663
#define F3DAUDIO_DSP_SETTINGS_DECL
664
typedef struct F3DAUDIO_DSP_SETTINGS F3DAUDIO_DSP_SETTINGS;
665
#endif /* F3DAUDIO_DSP_SETTINGS_DECL */
666
667
FACTAPI uint32_t FACTSoundBank_Play3D(
668
FACTSoundBank *pSoundBank,
669
uint16_t nCueIndex,
670
uint32_t dwFlags,
671
int32_t timeOffset,
672
F3DAUDIO_DSP_SETTINGS *pDSPSettings,
673
FACTCue** ppCue /* Optional! */
674
);
675
676
FACTAPI uint32_t FACTSoundBank_Stop(
677
FACTSoundBank *pSoundBank,
678
uint16_t nCueIndex,
679
uint32_t dwFlags
680
);
681
682
FACTAPI uint32_t FACTSoundBank_Destroy(FACTSoundBank *pSoundBank);
683
684
FACTAPI uint32_t FACTSoundBank_GetState(
685
FACTSoundBank *pSoundBank,
686
uint32_t *pdwState
687
);
688
689
/* WaveBank Interface */
690
691
FACTAPI uint32_t FACTWaveBank_Destroy(FACTWaveBank *pWaveBank);
692
693
FACTAPI uint32_t FACTWaveBank_GetState(
694
FACTWaveBank *pWaveBank,
695
uint32_t *pdwState
696
);
697
698
FACTAPI uint32_t FACTWaveBank_GetNumWaves(
699
FACTWaveBank *pWaveBank,
700
uint16_t *pnNumWaves
701
);
702
703
FACTAPI uint16_t FACTWaveBank_GetWaveIndex(
704
FACTWaveBank *pWaveBank,
705
const char *szFriendlyName
706
);
707
708
FACTAPI uint32_t FACTWaveBank_GetWaveProperties(
709
FACTWaveBank *pWaveBank,
710
uint16_t nWaveIndex,
711
FACTWaveProperties *pWaveProperties
712
);
713
714
FACTAPI uint32_t FACTWaveBank_Prepare(
715
FACTWaveBank *pWaveBank,
716
uint16_t nWaveIndex,
717
uint32_t dwFlags,
718
uint32_t dwPlayOffset,
719
uint8_t nLoopCount,
720
FACTWave **ppWave
721
);
722
723
FACTAPI uint32_t FACTWaveBank_Play(
724
FACTWaveBank *pWaveBank,
725
uint16_t nWaveIndex,
726
uint32_t dwFlags,
727
uint32_t dwPlayOffset,
728
uint8_t nLoopCount,
729
FACTWave **ppWave
730
);
731
732
FACTAPI uint32_t FACTWaveBank_Stop(
733
FACTWaveBank *pWaveBank,
734
uint16_t nWaveIndex,
735
uint32_t dwFlags
736
);
737
738
/* Wave Interface */
739
740
FACTAPI uint32_t FACTWave_Destroy(FACTWave *pWave);
741
742
FACTAPI uint32_t FACTWave_Play(FACTWave *pWave);
743
744
FACTAPI uint32_t FACTWave_Stop(FACTWave *pWave, uint32_t dwFlags);
745
746
FACTAPI uint32_t FACTWave_Pause(FACTWave *pWave, int32_t fPause);
747
748
FACTAPI uint32_t FACTWave_GetState(FACTWave *pWave, uint32_t *pdwState);
749
750
FACTAPI uint32_t FACTWave_SetPitch(FACTWave *pWave, int16_t pitch);
751
752
FACTAPI uint32_t FACTWave_SetVolume(FACTWave *pWave, float volume);
753
754
FACTAPI uint32_t FACTWave_SetMatrixCoefficients(
755
FACTWave *pWave,
756
uint32_t uSrcChannelCount,
757
uint32_t uDstChannelCount,
758
float *pMatrixCoefficients
759
);
760
761
FACTAPI uint32_t FACTWave_GetProperties(
762
FACTWave *pWave,
763
FACTWaveInstanceProperties *pProperties
764
);
765
766
/* Cue Interface */
767
768
FACTAPI uint32_t FACTCue_Destroy(FACTCue *pCue);
769
770
FACTAPI uint32_t FACTCue_Play(FACTCue *pCue);
771
772
FACTAPI uint32_t FACTCue_Stop(FACTCue *pCue, uint32_t dwFlags);
773
774
FACTAPI uint32_t FACTCue_GetState(FACTCue *pCue, uint32_t *pdwState);
775
776
FACTAPI uint32_t FACTCue_SetMatrixCoefficients(
777
FACTCue *pCue,
778
uint32_t uSrcChannelCount,
779
uint32_t uDstChannelCount,
780
float *pMatrixCoefficients
781
);
782
783
FACTAPI uint16_t FACTCue_GetVariableIndex(
784
FACTCue *pCue,
785
const char *szFriendlyName
786
);
787
788
FACTAPI uint32_t FACTCue_SetVariable(
789
FACTCue *pCue,
790
uint16_t nIndex,
791
float nValue
792
);
793
794
FACTAPI uint32_t FACTCue_GetVariable(
795
FACTCue *pCue,
796
uint16_t nIndex,
797
float *nValue
798
);
799
800
FACTAPI uint32_t FACTCue_Pause(FACTCue *pCue, int32_t fPause);
801
802
FACTAPI uint32_t FACTCue_GetProperties(
803
FACTCue *pCue,
804
FACTCueInstanceProperties **ppProperties
805
);
806
807
FACTAPI uint32_t FACTCue_SetOutputVoices(
808
FACTCue *pCue,
809
const FAudioVoiceSends *pSendList /* Optional! */
810
);
811
812
FACTAPI uint32_t FACTCue_SetOutputVoiceMatrix(
813
FACTCue *pCue,
814
const FAudioVoice *pDestinationVoice, /* Optional! */
815
uint32_t SourceChannels,
816
uint32_t DestinationChannels,
817
const float *pLevelMatrix /* SourceChannels * DestinationChannels */
818
);
819
820
#ifdef __cplusplus
821
}
822
#endif /* __cplusplus */
823
824
#endif /* FACT_H */
825
826
/* vim: set noexpandtab shiftwidth=8 tabstop=8: */
827
828