comparison decoders/timidity/timidity.c @ 249:e122de403a2d

Patch to not puke on Timidity++-specific config file directives.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 07 Feb 2002 07:48:24 +0000
parents 2d887640d300
children a73c51c12452
comparison
equal deleted inserted replaced
248:effbf695ba58 249:e122de403a2d
98 98
99 while (RWgets(rw, tmp, sizeof(tmp))) 99 while (RWgets(rw, tmp, sizeof(tmp)))
100 { 100 {
101 line++; 101 line++;
102 w[words=0]=strtok(tmp, " \t\240"); 102 w[words=0]=strtok(tmp, " \t\240");
103 if (!w[0] || (*w[0]=='#')) continue; 103 if (!w[0]) continue;
104
105 /* Originally the TiMidity++ extensions were prefixed like this */
106 if (strcmp(w[0], "#extension") == 0)
107 words = -1;
108 else if (*w[0] == '#')
109 continue;
110
104 while (w[words] && *w[words] != '#' && (words < MAXWORDS)) 111 while (w[words] && *w[words] != '#' && (words < MAXWORDS))
105 w[++words]=strtok(0," \t\240"); 112 w[++words]=strtok(0," \t\240");
106 if (!strcmp(w[0], "dir")) 113
114 /*
115 * TiMidity++ adds a number of extensions to the config file format.
116 * Many of them are completely irrelevant to SDL_sound, but at least
117 * we shouldn't choke on them.
118 *
119 * Unfortunately the documentation for these extensions is often quite
120 * vague, gramatically strange or completely absent.
121 */
122 if (
123 !strcmp(w[0], "comm") /* "comm" program second */
124 || !strcmp(w[0], "HTTPproxy") /* "HTTPproxy" hostname:port */
125 || !strcmp(w[0], "FTPproxy") /* "FTPproxy" hostname:port */
126 || !strcmp(w[0], "mailaddr") /* "mailaddr" your-mail-address */
127 || !strcmp(w[0], "opt") /* "opt" timidity-options */
128 )
129 {
130 /*
131 * + "comm" sets some kind of comment -- the documentation is too
132 * vague for me to understand at this time.
133 * + "HTTPproxy", "FTPproxy" and "mailaddr" are for reading data
134 * over a network, rather than from the file system.
135 * + "opt" specifies default options for TiMidity++.
136 *
137 * These are all quite useless for our version of TiMidity, so
138 * they can safely remain no-ops.
139 */
140 } else if (!strcmp(w[0], "timeout")) /* "timeout" program second */
141 {
142 /*
143 * Specifies a timeout value of the program. A number of seconds
144 * before TiMidity kills the note. This may be useful to implement
145 * later, but I don't see any urgent need for it.
146 */
147 SNDDBG(("FIXME: Implement \"timeout\" in TiMidity config.\n"));
148 } else if (!strcmp(w[0], "copydrumset") /* "copydrumset" drumset */
149 || !strcmp(w[0], "copybank")) /* "copybank" bank */
150 {
151 /*
152 * Copies all the settings of the specified drumset or bank to
153 * the current drumset or bank. May be useful later, but not a
154 * high priority.
155 */
156 SNDDBG(("FIXME: Implement \"%s\" in TiMidity config.\n", w[0]));
157 } else if (!strcmp(w[0], "undef")) /* "undef" progno */
158 {
159 /*
160 * Undefines the tone "progno" of the current tone bank (or
161 * drum set?). Not a high priority.
162 */
163 SNDDBG(("FIXME: Implement \"undef\" in TiMidity config.\n"));
164 } else if (!strcmp(w[0], "altassign")) /* "altassign" prog1 prog2 ... */
165 {
166 /*
167 * Sets the alternate assign for drum set. Whatever that's
168 * supposed to mean.
169 */
170 SNDDBG(("FIXME: Implement \"altassign\" in TiMidity config.\n"));
171 } else if (!strcmp(w[0], "soundfont")
172 || !strcmp(w[0], "font"))
173 {
174 /*
175 * I can't find any documentation for these, but I guess they're
176 * an alternative way of loading/unloading instruments.
177 *
178 * "soundfont" sf_file "remove"
179 * "soundfont" sf_file ["order=" order] ["cutoff=" cutoff]
180 * ["reso=" reso] ["amp=" amp]
181 * "font" "exclude" bank preset keynote
182 * "font" "order" order bank preset keynote
183 */
184 SNDDBG(("FIXME: Implmement \"%s\" in TiMidity config.\n", w[0]));
185 } else if (!strcmp(w[0], "progbase"))
186 {
187 /*
188 * The documentation for this makes absolutely no sense to me, but
189 * apparently it sets some sort of base offset for tone numbers.
190 * Why anyone would want to do this is beyond me.
191 */
192 SNDDBG(("FIXME: Implement \"progbase\" in TiMidity config.\n"));
193 } else if (!strcmp(w[0], "map")) /* "map" name set1 elem1 set2 elem2 */
194 {
195 /*
196 * This extension is the one we will need to implement, as it is
197 * used by the "eawpats". Unfortunately I cannot find any
198 * documentation whatsoever for it, but it looks like it's used
199 * for remapping one instrument to another somehow.
200 */
201 SNDDBG(("FIXME: Implement \"map\" in TiMidity config.\n"));
202 }
203
204 /* Standard TiMidity config */
205
206 else if (!strcmp(w[0], "dir"))
107 { 207 {
108 if (words < 2) 208 if (words < 2)
109 { 209 {
110 SNDDBG(("%s: line %d: No directory given\n", name, line)); 210 SNDDBG(("%s: line %d: No directory given\n", name, line));
111 return -2; 211 return -2;