annotate lib/legacy_dx/dmdls.h @ 0:9c0607679772

init
author Ritor1
date Sat, 12 Jan 2013 09:45:18 +0600
parents
children
rev   line source
0
Ritor1
parents:
diff changeset
1 /************************************************************************
Ritor1
parents:
diff changeset
2 * *
Ritor1
parents:
diff changeset
3 * dmdls.h -- DLS download definitions for DirectMusic API's *
Ritor1
parents:
diff changeset
4 * *
Ritor1
parents:
diff changeset
5 * Copyright (c) Microsoft Corporation. All rights reserved. *
Ritor1
parents:
diff changeset
6 * *
Ritor1
parents:
diff changeset
7 ************************************************************************/
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9 #ifndef _DMDLS_
Ritor1
parents:
diff changeset
10 #define _DMDLS_
Ritor1
parents:
diff changeset
11
Ritor1
parents:
diff changeset
12 #include "dls1.h"
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14 typedef long PCENT; /* Pitch cents */
Ritor1
parents:
diff changeset
15 typedef long GCENT; /* Gain cents */
Ritor1
parents:
diff changeset
16 typedef long TCENT; /* Time cents */
Ritor1
parents:
diff changeset
17 typedef long PERCENT; /* Per.. cent! */
Ritor1
parents:
diff changeset
18
Ritor1
parents:
diff changeset
19 typedef LONGLONG REFERENCE_TIME;
Ritor1
parents:
diff changeset
20 typedef REFERENCE_TIME *LPREFERENCE_TIME;
Ritor1
parents:
diff changeset
21
Ritor1
parents:
diff changeset
22 #ifndef MAKE_FOURCC
Ritor1
parents:
diff changeset
23 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
Ritor1
parents:
diff changeset
24 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
Ritor1
parents:
diff changeset
25 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28 typedef DWORD FOURCC; /* a four character code */
Ritor1
parents:
diff changeset
29 #endif
Ritor1
parents:
diff changeset
30
Ritor1
parents:
diff changeset
31 typedef struct _DMUS_DOWNLOADINFO
Ritor1
parents:
diff changeset
32 {
Ritor1
parents:
diff changeset
33 DWORD dwDLType; /* Instrument or Wave */
Ritor1
parents:
diff changeset
34 DWORD dwDLId; /* Unique identifier to tag this download. */
Ritor1
parents:
diff changeset
35 DWORD dwNumOffsetTableEntries; /* Number of index in the offset address table. */
Ritor1
parents:
diff changeset
36 DWORD cbSize; /* Total size of this memory chunk. */
Ritor1
parents:
diff changeset
37 } DMUS_DOWNLOADINFO;
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39 #define DMUS_DOWNLOADINFO_INSTRUMENT 1
Ritor1
parents:
diff changeset
40 #define DMUS_DOWNLOADINFO_WAVE 2
Ritor1
parents:
diff changeset
41 #define DMUS_DOWNLOADINFO_INSTRUMENT2 3 /* New version for better DLS2 support. */
Ritor1
parents:
diff changeset
42
Ritor1
parents:
diff changeset
43 /* Support for oneshot and streaming wave data
Ritor1
parents:
diff changeset
44 */
Ritor1
parents:
diff changeset
45 #define DMUS_DOWNLOADINFO_WAVEARTICULATION 4 /* Wave articulation data */
Ritor1
parents:
diff changeset
46 #define DMUS_DOWNLOADINFO_STREAMINGWAVE 5 /* One chunk of a streaming */
Ritor1
parents:
diff changeset
47 #define DMUS_DOWNLOADINFO_ONESHOTWAVE 6
Ritor1
parents:
diff changeset
48
Ritor1
parents:
diff changeset
49 #define DMUS_DEFAULT_SIZE_OFFSETTABLE 1
Ritor1
parents:
diff changeset
50
Ritor1
parents:
diff changeset
51 /* Flags for DMUS_INSTRUMENT's ulFlags member */
Ritor1
parents:
diff changeset
52
Ritor1
parents:
diff changeset
53 #define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0)
Ritor1
parents:
diff changeset
54
Ritor1
parents:
diff changeset
55 typedef struct _DMUS_OFFSETTABLE
Ritor1
parents:
diff changeset
56 {
Ritor1
parents:
diff changeset
57 ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
Ritor1
parents:
diff changeset
58 } DMUS_OFFSETTABLE;
Ritor1
parents:
diff changeset
59
Ritor1
parents:
diff changeset
60 typedef struct _DMUS_INSTRUMENT
Ritor1
parents:
diff changeset
61 {
Ritor1
parents:
diff changeset
62 ULONG ulPatch;
Ritor1
parents:
diff changeset
63 ULONG ulFirstRegionIdx;
Ritor1
parents:
diff changeset
64 ULONG ulGlobalArtIdx; /* If zero the instrument does not have an articulation */
Ritor1
parents:
diff changeset
65 ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the instrument */
Ritor1
parents:
diff changeset
66 ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the instrument */
Ritor1
parents:
diff changeset
67 ULONG ulFlags;
Ritor1
parents:
diff changeset
68 } DMUS_INSTRUMENT;
Ritor1
parents:
diff changeset
69
Ritor1
parents:
diff changeset
70 typedef struct _DMUS_REGION
Ritor1
parents:
diff changeset
71 {
Ritor1
parents:
diff changeset
72 RGNRANGE RangeKey;
Ritor1
parents:
diff changeset
73 RGNRANGE RangeVelocity;
Ritor1
parents:
diff changeset
74 USHORT fusOptions;
Ritor1
parents:
diff changeset
75 USHORT usKeyGroup;
Ritor1
parents:
diff changeset
76 ULONG ulRegionArtIdx; /* If zero the region does not have an articulation */
Ritor1
parents:
diff changeset
77 ULONG ulNextRegionIdx; /* If zero no more regions */
Ritor1
parents:
diff changeset
78 ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the region */
Ritor1
parents:
diff changeset
79 WAVELINK WaveLink;
Ritor1
parents:
diff changeset
80 WSMPL WSMP; /* If WSMP.cSampleLoops > 1 then a WLOOP is included */
Ritor1
parents:
diff changeset
81 WLOOP WLOOP[1];
Ritor1
parents:
diff changeset
82 } DMUS_REGION;
Ritor1
parents:
diff changeset
83
Ritor1
parents:
diff changeset
84 typedef struct _DMUS_LFOPARAMS
Ritor1
parents:
diff changeset
85 {
Ritor1
parents:
diff changeset
86 PCENT pcFrequency;
Ritor1
parents:
diff changeset
87 TCENT tcDelay;
Ritor1
parents:
diff changeset
88 GCENT gcVolumeScale;
Ritor1
parents:
diff changeset
89 PCENT pcPitchScale;
Ritor1
parents:
diff changeset
90 GCENT gcMWToVolume;
Ritor1
parents:
diff changeset
91 PCENT pcMWToPitch;
Ritor1
parents:
diff changeset
92 } DMUS_LFOPARAMS;
Ritor1
parents:
diff changeset
93
Ritor1
parents:
diff changeset
94 typedef struct _DMUS_VEGPARAMS
Ritor1
parents:
diff changeset
95 {
Ritor1
parents:
diff changeset
96 TCENT tcAttack;
Ritor1
parents:
diff changeset
97 TCENT tcDecay;
Ritor1
parents:
diff changeset
98 PERCENT ptSustain;
Ritor1
parents:
diff changeset
99 TCENT tcRelease;
Ritor1
parents:
diff changeset
100 TCENT tcVel2Attack;
Ritor1
parents:
diff changeset
101 TCENT tcKey2Decay;
Ritor1
parents:
diff changeset
102 } DMUS_VEGPARAMS;
Ritor1
parents:
diff changeset
103
Ritor1
parents:
diff changeset
104 typedef struct _DMUS_PEGPARAMS
Ritor1
parents:
diff changeset
105 {
Ritor1
parents:
diff changeset
106 TCENT tcAttack;
Ritor1
parents:
diff changeset
107 TCENT tcDecay;
Ritor1
parents:
diff changeset
108 PERCENT ptSustain;
Ritor1
parents:
diff changeset
109 TCENT tcRelease;
Ritor1
parents:
diff changeset
110 TCENT tcVel2Attack;
Ritor1
parents:
diff changeset
111 TCENT tcKey2Decay;
Ritor1
parents:
diff changeset
112 PCENT pcRange;
Ritor1
parents:
diff changeset
113 } DMUS_PEGPARAMS;
Ritor1
parents:
diff changeset
114
Ritor1
parents:
diff changeset
115 typedef struct _DMUS_MSCPARAMS
Ritor1
parents:
diff changeset
116 {
Ritor1
parents:
diff changeset
117 PERCENT ptDefaultPan;
Ritor1
parents:
diff changeset
118 } DMUS_MSCPARAMS;
Ritor1
parents:
diff changeset
119
Ritor1
parents:
diff changeset
120 typedef struct _DMUS_ARTICPARAMS
Ritor1
parents:
diff changeset
121 {
Ritor1
parents:
diff changeset
122 DMUS_LFOPARAMS LFO;
Ritor1
parents:
diff changeset
123 DMUS_VEGPARAMS VolEG;
Ritor1
parents:
diff changeset
124 DMUS_PEGPARAMS PitchEG;
Ritor1
parents:
diff changeset
125 DMUS_MSCPARAMS Misc;
Ritor1
parents:
diff changeset
126 } DMUS_ARTICPARAMS;
Ritor1
parents:
diff changeset
127
Ritor1
parents:
diff changeset
128 typedef struct _DMUS_ARTICULATION /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */
Ritor1
parents:
diff changeset
129 {
Ritor1
parents:
diff changeset
130 ULONG ulArt1Idx; /* DLS Level 1 articulation chunk */
Ritor1
parents:
diff changeset
131 ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
Ritor1
parents:
diff changeset
132 } DMUS_ARTICULATION;
Ritor1
parents:
diff changeset
133
Ritor1
parents:
diff changeset
134 typedef struct _DMUS_ARTICULATION2 /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */
Ritor1
parents:
diff changeset
135 {
Ritor1
parents:
diff changeset
136 ULONG ulArtIdx; /* DLS Level 1/2 articulation chunk */
Ritor1
parents:
diff changeset
137 ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
Ritor1
parents:
diff changeset
138 ULONG ulNextArtIdx; /* Additional articulation chunks */
Ritor1
parents:
diff changeset
139 } DMUS_ARTICULATION2;
Ritor1
parents:
diff changeset
140
Ritor1
parents:
diff changeset
141 #define DMUS_MIN_DATA_SIZE 4
Ritor1
parents:
diff changeset
142 /* The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */
Ritor1
parents:
diff changeset
143
Ritor1
parents:
diff changeset
144 typedef struct _DMUS_EXTENSIONCHUNK
Ritor1
parents:
diff changeset
145 {
Ritor1
parents:
diff changeset
146 ULONG cbSize; /* Size of extension chunk */
Ritor1
parents:
diff changeset
147 ULONG ulNextExtCkIdx; /* If zero no more 3rd party entenstion chunks */
Ritor1
parents:
diff changeset
148 FOURCC ExtCkID;
Ritor1
parents:
diff changeset
149 BYTE byExtCk[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
Ritor1
parents:
diff changeset
150 } DMUS_EXTENSIONCHUNK;
Ritor1
parents:
diff changeset
151
Ritor1
parents:
diff changeset
152 /* The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
Ritor1
parents:
diff changeset
153
Ritor1
parents:
diff changeset
154 typedef struct _DMUS_COPYRIGHT
Ritor1
parents:
diff changeset
155 {
Ritor1
parents:
diff changeset
156 ULONG cbSize; /* Size of copyright information */
Ritor1
parents:
diff changeset
157 BYTE byCopyright[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
Ritor1
parents:
diff changeset
158 } DMUS_COPYRIGHT;
Ritor1
parents:
diff changeset
159
Ritor1
parents:
diff changeset
160 typedef struct _DMUS_WAVEDATA
Ritor1
parents:
diff changeset
161 {
Ritor1
parents:
diff changeset
162 ULONG cbSize;
Ritor1
parents:
diff changeset
163 BYTE byData[DMUS_MIN_DATA_SIZE];
Ritor1
parents:
diff changeset
164 } DMUS_WAVEDATA;
Ritor1
parents:
diff changeset
165
Ritor1
parents:
diff changeset
166 typedef struct _DMUS_WAVE
Ritor1
parents:
diff changeset
167 {
Ritor1
parents:
diff changeset
168 ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the wave */
Ritor1
parents:
diff changeset
169 ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the wave */
Ritor1
parents:
diff changeset
170 ULONG ulWaveDataIdx; /* Location of actual wave data. */
Ritor1
parents:
diff changeset
171 WAVEFORMATEX WaveformatEx;
Ritor1
parents:
diff changeset
172 } DMUS_WAVE;
Ritor1
parents:
diff changeset
173
Ritor1
parents:
diff changeset
174 typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE;
Ritor1
parents:
diff changeset
175 typedef struct _DMUS_NOTERANGE
Ritor1
parents:
diff changeset
176 {
Ritor1
parents:
diff changeset
177 DWORD dwLowNote; /* Sets the low note for the range of MIDI note events to which the instrument responds.*/
Ritor1
parents:
diff changeset
178 DWORD dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/
Ritor1
parents:
diff changeset
179 } DMUS_NOTERANGE;
Ritor1
parents:
diff changeset
180
Ritor1
parents:
diff changeset
181 typedef struct _DMUS_WAVEARTDL
Ritor1
parents:
diff changeset
182 {
Ritor1
parents:
diff changeset
183 ULONG ulDownloadIdIdx; /* Download ID's of each buffer */
Ritor1
parents:
diff changeset
184 ULONG ulBus; /* Playback bus */
Ritor1
parents:
diff changeset
185 ULONG ulBuffers; /* Buffers */
Ritor1
parents:
diff changeset
186 ULONG ulMasterDLId; /* Download ID of master voice of slave group */
Ritor1
parents:
diff changeset
187 USHORT usOptions; /* Same as DLS2 region options */
Ritor1
parents:
diff changeset
188 } DMUS_WAVEARTDL,
Ritor1
parents:
diff changeset
189 *LPDMUS_WAVEARTDL;
Ritor1
parents:
diff changeset
190
Ritor1
parents:
diff changeset
191 typedef struct _DMUS_WAVEDL
Ritor1
parents:
diff changeset
192 {
Ritor1
parents:
diff changeset
193 ULONG cbWaveData; /* Bytes of wave data */
Ritor1
parents:
diff changeset
194 } DMUS_WAVEDL,
Ritor1
parents:
diff changeset
195 *LPDMUS_WAVEDL;
Ritor1
parents:
diff changeset
196
Ritor1
parents:
diff changeset
197 #endif
Ritor1
parents:
diff changeset
198
Ritor1
parents:
diff changeset
199