annotate decoders/timidity/dls1.h @ 474:c66080364dff

Most decoders now report total sample play time, now. Technically, this breaks binary compatibility with the 1.0 branch, since it extends the Sound_Sample struct, but most (all?) programs are just passing pointers allocated by SDL_sound around, and might be okay. Source-level compatibility is not broken...yet! :) --ryan. -------- Original Message -------- Subject: SDL_sound patch: Finding total length of time of sound file. Date: Sun, 26 Jan 2003 09:31:17 -0800 (PST) Hi Ryan, I am working with Eric Wing and helping him modify SDL_sound. AS part of our efforts in improving and enhancing SDL_sound, we like to submit this patch. We modified the codecs to find the total time of a sound file. Below is the explanation of the patch. The patch is appended as an attachment to this email. * MOTIVATION: We needed the ability to get the total play time of a sample (And we noticed that we're not the only ones). Since SDL_sound blocks direct access to the specific decoders, there is no way for a user to know this information short of decoding the whole thing. Because of this, we believe this will be a useful addition, even though the accuracy may not be perfect (subject to each decoder) or the information may not always be available. * CONTRIBUTORS: Wesley Leong (modified the majority of the codecs and verified the results) Eric Wing (showed everyone how to do modify codec, modified mikmod) Wang Lam (modified a handful of codecs, researched into specs and int overflow) Ahilan Anantha (modified a few codecs and helped with integer math) * GENERAL ISSUES: We chose the value to be milliseconds as an Sint32. Milliseconds because that's what Sound_Seek takes as a parameter and -1 to allow for instances/codecs where the value could not be determined. We are not sure if this is the final convention you want, so we are willing to work with you on this. We also expect the total_time field to be set on open and never again modified by SDL_sound. Users may access it directly much like the sample buffer and buffer_size. We thought about recomputing the time on DecodeAll, but since users may seek or decode small chunks first, not all the data may be there. So this is better done by the user. This may be good information to document. Currently, all the main codecs are implemented except for QuickTime.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 08 May 2004 08:19:50 +0000
parents cbc2a4ffeeec
children
rev   line source
455
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
1 /*==========================================================================;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
2 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
3 // dls1.h
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
4 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
5 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
6 // Description:
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
7 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
8 // Interface defines and structures for the Instrument Collection Form
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
9 // RIFF DLS.
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
10 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
11 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
12 // Written by Sonic Foundry 1996. Released for public use.
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
13 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
14 //=========================================================================*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
15
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
16 #ifndef _INC_DLS1
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
17 #define _INC_DLS1
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
18
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
19 /*//////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
20 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
21 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
22 // Layout of an instrument collection:
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
23 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
24 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
25 // RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
26 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
27 // INSTLIST
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
28 // LIST [] 'lins'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
29 // LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
30 // LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
31 // LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
32 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
33 // RGNLIST
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
34 // LIST [] 'lrgn'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
35 // LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
36 // LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
37 // LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
38 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
39 // ARTLIST
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
40 // LIST [] 'lart'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
41 // 'art1' level 1 Articulation connection graph
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
42 // 'art2' level 2 Articulation connection graph
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
43 // '3rd1' Possible 3rd party articulation structure 1
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
44 // '3rd2' Possible 3rd party articulation structure 2 .... and so on
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
45 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
46 // WAVEPOOL
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
47 // ptbl [] [pool table]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
48 // LIST [] 'wvpl'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
49 // [path],
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
50 // [path],
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
51 // LIST [] 'wave' [dlid,RIFFWAVE]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
52 // LIST [] 'wave' [dlid,RIFFWAVE]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
53 // LIST [] 'wave' [dlid,RIFFWAVE]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
54 // LIST [] 'wave' [dlid,RIFFWAVE]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
55 // LIST [] 'wave' [dlid,RIFFWAVE]
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
56 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
57 // INFOLIST
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
58 // LIST [] 'INFO'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
59 // 'icmt' 'One of those crazy comments.'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
60 // 'icop' 'Copyright (C) 1996 Sonic Foundry'
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
61 //
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
62 /////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
63
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
64
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
65 /*/////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
66 // FOURCC's used in the DLS file
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
67 /////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
68
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
69 #define FOURCC_DLS mmioFOURCC('D','L','S',' ')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
70 #define FOURCC_DLID mmioFOURCC('d','l','i','d')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
71 #define FOURCC_COLH mmioFOURCC('c','o','l','h')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
72 #define FOURCC_WVPL mmioFOURCC('w','v','p','l')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
73 #define FOURCC_PTBL mmioFOURCC('p','t','b','l')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
74 #define FOURCC_PATH mmioFOURCC('p','a','t','h')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
75 #define FOURCC_wave mmioFOURCC('w','a','v','e')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
76 #define FOURCC_LINS mmioFOURCC('l','i','n','s')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
77 #define FOURCC_INS mmioFOURCC('i','n','s',' ')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
78 #define FOURCC_INSH mmioFOURCC('i','n','s','h')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
79 #define FOURCC_LRGN mmioFOURCC('l','r','g','n')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
80 #define FOURCC_RGN mmioFOURCC('r','g','n',' ')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
81 #define FOURCC_RGNH mmioFOURCC('r','g','n','h')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
82 #define FOURCC_LART mmioFOURCC('l','a','r','t')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
83 #define FOURCC_ART1 mmioFOURCC('a','r','t','1')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
84 #define FOURCC_WLNK mmioFOURCC('w','l','n','k')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
85 #define FOURCC_WSMP mmioFOURCC('w','s','m','p')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
86 #define FOURCC_VERS mmioFOURCC('v','e','r','s')
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
87
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
88 /*/////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
89 // Articulation connection graph definitions
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
90 /////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
91
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
92 /* Generic Sources */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
93 #define CONN_SRC_NONE 0x0000
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
94 #define CONN_SRC_LFO 0x0001
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
95 #define CONN_SRC_KEYONVELOCITY 0x0002
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
96 #define CONN_SRC_KEYNUMBER 0x0003
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
97 #define CONN_SRC_EG1 0x0004
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
98 #define CONN_SRC_EG2 0x0005
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
99 #define CONN_SRC_PITCHWHEEL 0x0006
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
100
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
101 /* Midi Controllers 0-127 */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
102 #define CONN_SRC_CC1 0x0081
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
103 #define CONN_SRC_CC7 0x0087
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
104 #define CONN_SRC_CC10 0x008a
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
105 #define CONN_SRC_CC11 0x008b
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
106
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
107 /* Generic Destinations */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
108 #define CONN_DST_NONE 0x0000
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
109 #define CONN_DST_ATTENUATION 0x0001
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
110 #define CONN_DST_PITCH 0x0003
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
111 #define CONN_DST_PAN 0x0004
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
112
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
113 /* LFO Destinations */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
114 #define CONN_DST_LFO_FREQUENCY 0x0104
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
115 #define CONN_DST_LFO_STARTDELAY 0x0105
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
116
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
117 /* EG1 Destinations */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
118 #define CONN_DST_EG1_ATTACKTIME 0x0206
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
119 #define CONN_DST_EG1_DECAYTIME 0x0207
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
120 #define CONN_DST_EG1_RELEASETIME 0x0209
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
121 #define CONN_DST_EG1_SUSTAINLEVEL 0x020a
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
122
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
123 /* EG2 Destinations */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
124 #define CONN_DST_EG2_ATTACKTIME 0x030a
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
125 #define CONN_DST_EG2_DECAYTIME 0x030b
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
126 #define CONN_DST_EG2_RELEASETIME 0x030d
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
127 #define CONN_DST_EG2_SUSTAINLEVEL 0x030e
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
128
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
129 #define CONN_TRN_NONE 0x0000
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
130 #define CONN_TRN_CONCAVE 0x0001
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
131
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
132 typedef struct _DLSID {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
133 ULONG ulData1;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
134 USHORT usData2;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
135 USHORT usData3;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
136 BYTE abData4[8];
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
137 } DLSID, FAR *LPDLSID;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
138
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
139 typedef struct _DLSVERSION {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
140 DWORD dwVersionMS;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
141 DWORD dwVersionLS;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
142 } DLSVERSION, FAR *LPDLSVERSION;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
143
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
144
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
145 typedef struct _CONNECTION {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
146 USHORT usSource;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
147 USHORT usControl;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
148 USHORT usDestination;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
149 USHORT usTransform;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
150 LONG lScale;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
151 } CONNECTION, FAR *LPCONNECTION;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
152
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
153
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
154 /* Level 1 Articulation Data */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
155
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
156 typedef struct _CONNECTIONLIST {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
157 ULONG cbSize; /* size of the connection list structure */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
158 ULONG cConnections; /* count of connections in the list */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
159 } CONNECTIONLIST, FAR *LPCONNECTIONLIST;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
160
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
161
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
162
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
163 /*/////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
164 // Generic type defines for regions and instruments
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
165 /////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
166
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
167 typedef struct _RGNRANGE {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
168 USHORT usLow;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
169 USHORT usHigh;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
170 } RGNRANGE, FAR * LPRGNRANGE;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
171
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
172 #define F_INSTRUMENT_DRUMS 0x80000000
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
173
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
174 typedef struct _MIDILOCALE {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
175 ULONG ulBank;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
176 ULONG ulInstrument;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
177 } MIDILOCALE, FAR *LPMIDILOCALE;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
178
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
179 /*/////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
180 // Header structures found in an DLS file for collection, instruments, and
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
181 // regions.
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
182 /////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
183
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
184 #define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
185
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
186 typedef struct _RGNHEADER {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
187 RGNRANGE RangeKey; /* Key range */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
188 RGNRANGE RangeVelocity; /* Velocity Range */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
189 USHORT fusOptions; /* Synthesis options for this range */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
190 USHORT usKeyGroup; /* Key grouping for non simultaneous play */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
191 /* 0 = no group, 1 up is group */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
192 /* for Level 1 only groups 1-15 are allowed */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
193 } RGNHEADER, FAR *LPRGNHEADER;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
194
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
195 typedef struct _INSTHEADER {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
196 ULONG cRegions; /* Count of regions in this instrument */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
197 MIDILOCALE Locale; /* Intended MIDI locale of this instrument */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
198 } INSTHEADER, FAR *LPINSTHEADER;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
199
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
200 typedef struct _DLSHEADER {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
201 ULONG cInstruments; /* Count of instruments in the collection */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
202 } DLSHEADER, FAR *LPDLSHEADER;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
203
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
204 /*////////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
205 // definitions for the Wave link structure
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
206 ////////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
207
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
208 /* **** For level 1 only WAVELINK_CHANNEL_MONO is valid **** */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
209 /* ulChannel allows for up to 32 channels of audio with each bit position */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
210 /* specifiying a channel of playback */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
211
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
212 #define WAVELINK_CHANNEL_LEFT 0x0001l
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
213 #define WAVELINK_CHANNEL_RIGHT 0x0002l
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
214
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
215 #define F_WAVELINK_PHASE_MASTER 0x0001
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
216
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
217 typedef struct _WAVELINK { /* any paths or links are stored right after struct */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
218 USHORT fusOptions; /* options flags for this wave */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
219 USHORT usPhaseGroup; /* Phase grouping for locking channels */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
220 ULONG ulChannel; /* channel placement */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
221 ULONG ulTableIndex; /* index into the wave pool table, 0 based */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
222 } WAVELINK, FAR *LPWAVELINK;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
223
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
224 #define POOL_CUE_NULL 0xffffffffl
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
225
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
226 typedef struct _POOLCUE {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
227 ULONG ulOffset; /* Offset to the entry in the list */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
228 } POOLCUE, FAR *LPPOOLCUE;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
229
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
230 typedef struct _POOLTABLE {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
231 ULONG cbSize; /* size of the pool table structure */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
232 ULONG cCues; /* count of cues in the list */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
233 } POOLTABLE, FAR *LPPOOLTABLE;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
234
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
235 /*////////////////////////////////////////////////////////////////////////////
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
236 // Structures for the "wsmp" chunk
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
237 ////////////////////////////////////////////////////////////////////////////*/
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
238
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
239 #define F_WSMP_NO_TRUNCATION 0x0001l
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
240 #define F_WSMP_NO_COMPRESSION 0x0002l
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
241
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
242
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
243 typedef struct _rwsmp {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
244 ULONG cbSize;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
245 USHORT usUnityNote; /* MIDI Unity Playback Note */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
246 SHORT sFineTune; /* Fine Tune in log tuning */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
247 LONG lAttenuation; /* Overall Attenuation to be applied to data */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
248 ULONG fulOptions; /* Flag options */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
249 ULONG cSampleLoops; /* Count of Sample loops, 0 loops is one shot */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
250 } WSMPL, FAR *LPWSMPL;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
251
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
252
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
253 /* This loop type is a normal forward playing loop which is continually */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
254 /* played until the envelope reaches an off threshold in the release */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
255 /* portion of the volume envelope */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
256
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
257 #define WLOOP_TYPE_FORWARD 0
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
258
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
259 typedef struct _rloop {
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
260 ULONG cbSize;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
261 ULONG ulType; /* Loop Type */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
262 ULONG ulStart; /* Start of loop in samples */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
263 ULONG ulLength; /* Length of loop in samples */
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
264 } WLOOP, FAR *LPWLOOP;
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
265
cbc2a4ffeeec * Added support for loading DLS format instruments:
hercules
parents:
diff changeset
266 #endif /*_INC_DLS1 */