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