2 * Copyright (c) 2020 Vijay Kiran Kamuju
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 typedef DWORD WAVEBANKOFFSET
;
26 #define WAVEBANK_HEADER_SIGNATURE 0x444e4257 /* DNBW */
27 #define WAVEBANK_BANKNAME_LENGTH 64
28 #define WAVEBANK_ENTRYNAME_LENGTH 64
30 #define WAVEBANK_TYPE_BUFFER 0x00000000
31 #define WAVEBANK_TYPE_STREAMING 0x00000001
32 #define WAVEBANK_TYPE_MASK 0x00000001
34 #define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000
35 #define WAVEBANK_FLAGS_COMPACT 0x00020000
36 #define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000
37 #define WAVEBANK_FLAGS_SEEKTABLES 0x00080000
39 #define WAVEBANK_DVD_SECTOR_SIZE 2048
40 #define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16)
41 #define WAVEBANK_ALIGNMENT_MIN 4
42 #define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE
44 typedef enum WAVEBANKSEGIDX
46 WAVEBANK_SEGIDX_BANKDATA
= 0,
47 WAVEBANK_SEGIDX_ENTRYMETADATA
,
48 WAVEBANK_SEGIDX_SEEKTABLES
,
49 WAVEBANK_SEGIDX_ENTRYNAMES
,
50 WAVEBANK_SEGIDX_ENTRYWAVEDATA
,
52 } WAVEBANKSEGIDX
, *LPWAVEBANKSEGIDX
;
53 typedef const WAVEBANKSEGIDX
*LPCWAVEBANKSEGIDX
;
55 #define WAVEBANKMINIFORMAT_TAG_PCM 0x0
56 #define WAVEBANKMINIFORMAT_TAG_XMA 0x1
57 #define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2
59 #define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0
60 #define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1
62 typedef union WAVEBANKMINIWAVEFORMAT
68 DWORD nSamplesPerSec
: 18;
69 DWORD wBlockAlign
: 8;
70 DWORD wBitsPerSample
: 1;
73 } WAVEBANKMINIWAVEFORMAT
, *LPWAVEBANKMINIWAVEFORMAT
;
74 typedef const WAVEBANKMINIWAVEFORMAT
*LPCWAVEBANKMINIWAVEFORMAT
;
76 typedef struct WAVEBANKREGION
80 } WAVEBANKREGION
, *LPWAVEBANKREGION
;
81 typedef const WAVEBANKREGION
*LPCWAVEBANKREGION
;
83 typedef struct WAVEBANKSAMPLEREGION
87 } WAVEBANKSAMPLEREGION
, *LPWAVEBANKSAMPLEREGION
;
88 typedef const WAVEBANKSAMPLEREGION
*LPCWAVEBANKSAMPLEREGION
;
90 typedef struct WAVEBANKHEADER
94 #if XACT3_VER >= 0x0205
95 DWORD dwHeaderVersion
;
97 WAVEBANKREGION Segments
[WAVEBANK_SEGIDX_COUNT
];
98 } WAVEBANKHEADER
, *LPWAVEBANKHEADER
;
99 typedef const WAVEBANKHEADER
*LPCWAVEBANKHEADER
;
101 #define WAVEBANKENTRY_XMASTREAMS_MAX 3
102 #define WAVEBANKENTRY_XMACHANNELS_MAX 6
104 #define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001
105 #define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002
106 #define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004
107 #define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008
108 #define WAVEBANKENTRY_FLAGS_MASK 0x00000008
110 typedef struct WAVEBANKENTRY
119 DWORD dwFlagsAndDuration
;
122 WAVEBANKMINIWAVEFORMAT Format
;
123 WAVEBANKREGION PlayRegion
;
124 #if XACT3_VER >= 0x0202
125 WAVEBANKSAMPLEREGION LoopRegion
;
129 WAVEBANKREGION LoopRegion
;
133 DWORD nSubframeSkip
: 2;
134 DWORD nSubframeEnd
: 2;
135 DWORD dwEndOffset
: 28;
136 } XMALoopRegion
[WAVEBANKENTRY_XMASTREAMS_MAX
];
137 WAVEBANKREGION LoopRegionAlias
[WAVEBANKENTRY_XMASTREAMS_MAX
];
140 } WAVEBANKENTRY
, *LPWAVEBANKENTRY
;
141 typedef const WAVEBANKENTRY
*LPCWAVEBANKENTRY
;
143 typedef struct WAVEBANKENTRYCOMPACT
146 DWORD dwLengthDeviation
: 11;
147 } WAVEBANKENTRYCOMPACT
, *LPWAVEBANKENTRYCOMPACT
;
148 typedef const WAVEBANKENTRYCOMPACT
*LPCWAVEBANKENTRYCOMPACT
;
150 typedef struct WAVEBANKDATA
154 CHAR szBankName
[WAVEBANK_BANKNAME_LENGTH
];
155 DWORD dwEntryMetaDataElementSize
;
156 DWORD dwEntryNameElementSize
;
158 WAVEBANKMINIWAVEFORMAT CompactFormat
;
160 } WAVEBANKDATA
, *LPWAVEBANKDATA
;
161 typedef const WAVEBANKDATA
*LPCWAVEBANKDATA
;
165 #endif /* __XACT2WB_H__ */