@@ -138,18 +138,28 @@ static void usage()
138
138
" Output selection:\n "
139
139
" -e, --emulator=EMULATOR specify emulator to use\n "
140
140
" -O, --output=OUTPUT specify output mechanism\n\n "
141
+ #ifdef DRIVER_OSS
141
142
" OSS driver (oss) specific:\n "
142
143
" -d, --device=FILE set sound device file to FILE\n "
143
144
" -b, --buffer=SIZE set output buffer size to SIZE\n\n "
145
+ #endif
146
+ #ifdef DRIVER_DISK
144
147
" Disk writer (disk) specific:\n "
145
148
" -d, --device=FILE output to FILE ('-' is stdout)\n\n "
149
+ #endif
150
+ #ifdef DRIVER_ESOUND
146
151
" EsounD driver (esound) specific:\n "
147
152
" -d, --device=URL URL to EsounD server host (hostname:port)\n\n "
153
+ #endif
154
+ #ifdef DRIVER_SDL
148
155
" SDL driver (sdl) specific:\n "
149
156
" -b, --buffer=SIZE set output buffer size to SIZE\n\n "
157
+ #endif
158
+ #ifdef DRIVER_ALSA
150
159
" ALSA driver (alsa) specific:\n "
151
160
" -d, --device=DEVICE set sound device to DEVICE\n "
152
161
" -b, --buffer=SIZE set output buffer size to SIZE\n\n "
162
+ #endif
153
163
" Playback quality:\n "
154
164
" -8, --8bit 8-bit sample quality\n "
155
165
" --16bit 16-bit sample quality\n "
@@ -263,18 +273,42 @@ static int decode_switches(int argc, char **argv)
263
273
message (MSG_WARN, " could not open database -- %s" , optarg);
264
274
break ;
265
275
case ' O' :
276
+ #ifdef DRIVER_OSS
266
277
if (!strcmp (optarg," oss" )) cfg.output = oss;
267
- else if (!strcmp (optarg," null" )) cfg.output = null;
268
- else if (!strcmp (optarg," disk" )) {
278
+ else
279
+ #endif
280
+ #ifdef DRIVER_NULL
281
+ if (!strcmp (optarg," null" )) cfg.output = null;
282
+ else
283
+ #endif
284
+ #ifdef DRIVER_DISK
285
+ if (!strcmp (optarg," disk" )) {
269
286
cfg.output = disk;
270
287
cfg.endless = false ; // endless output is almost never desired here
271
288
}
272
- else if (!strcmp (optarg," esound" )) cfg.output = esound;
273
- else if (!strcmp (optarg," qsa" )) cfg.output = qsa;
274
- else if (!strcmp (optarg," alsa" )) cfg.output = alsa;
275
- else if (!strcmp (optarg," sdl" )) cfg.output = sdl;
276
- else if (!strcmp (optarg," ao" )) cfg.output = ao;
277
- else {
289
+ else
290
+ #endif
291
+ #ifdef DRIVER_ESOUND
292
+ if (!strcmp (optarg," esound" )) cfg.output = esound;
293
+ else
294
+ #endif
295
+ #ifdef DRIVER_QSA
296
+ if (!strcmp (optarg," qsa" )) cfg.output = qsa;
297
+ else
298
+ #endif
299
+ #ifdef DRIVER_ALSA
300
+ if (!strcmp (optarg," alsa" )) cfg.output = alsa;
301
+ else
302
+ #endif
303
+ #ifdef DRIVER_SDL
304
+ if (!strcmp (optarg," sdl" )) cfg.output = sdl;
305
+ else
306
+ #endif
307
+ #ifdef DRIVER_AO
308
+ if (!strcmp (optarg," ao" )) cfg.output = ao;
309
+ else
310
+ #endif
311
+ {
278
312
message (MSG_ERROR, " unknown output method -- %s" , optarg);
279
313
exit (EXIT_FAILURE);
280
314
}
@@ -545,7 +579,6 @@ int main(int argc, char **argv)
545
579
player = new AOPlayer (opl, cfg.device , cfg.bits , cfg.channels , cfg.freq , cfg.buf_size );
546
580
break ;
547
581
#endif
548
- #
549
582
#ifdef DRIVER_SDL
550
583
case sdl:
551
584
player = new SDLPlayer (opl, cfg.bits , cfg.channels , cfg.freq , cfg.buf_size );
0 commit comments