diff --git a/src/common.h b/src/common.h index 6d1e835..fb0d9a6 100644 --- a/src/common.h +++ b/src/common.h @@ -11,6 +11,7 @@ struct options { int verbose; int silent; /* silent output */ int info; /* display information and exit */ + int probeonly; /* probe sound driver and exit */ char *drv_id; /* sound driver ID */ char *out_file; /* output file name */ char *ins_path; /* instrument path */ diff --git a/src/main.c b/src/main.c index 99a39a9..c28600e 100644 --- a/src/main.c +++ b/src/main.c @@ -156,7 +156,7 @@ int main(int argc, char **argv) get_options(argc, argv, &options); - if (optind >= argc) { + if (!options.probeonly && optind >= argc) { fprintf (stderr, "%s: no modules to play\n" "Use `%s --help' for more information.\n", argv[0], argv[0]); @@ -185,6 +185,9 @@ int main(int argc, char **argv) options.format & XMP_FORMAT_8BIT ? 8 : 16, options.format & XMP_FORMAT_MONO ? "mono" : "stereo"); + if (options.probeonly) { + exit(EXIT_SUCCESS); + } if (options.random) { shuffle(argc - optind + 1, &argv[optind - 1]); diff --git a/src/options.c b/src/options.c index 7c8fc86..98df0a4 100644 --- a/src/options.c +++ b/src/options.c @@ -22,9 +22,6 @@ extern char *optarg; static int o, i; static char *token; -extern int probeonly; -extern int randomize; -extern int nocmd; #ifdef HAVE_SYS_RTPRIO_H extern int rt; #endif @@ -132,6 +129,7 @@ static struct option lopt[] = { { "mute", 1, 0, 'M' }, { "output-file", 1, 0, 'o' }, { "pan", 1, 0, 'P' }, + { "probe-only", 0, 0, OPT_PROBEONLY }, { "quiet", 0, 0, 'q' }, { "random", 0, 0, 'R' }, { "solo", 1, 0, 'S' }, @@ -218,6 +216,9 @@ void get_options(int argc, char **argv, struct options *options) if (options->mix > 100) options->mix = 100; break; + case OPT_PROBEONLY: + options->probeonly = 1; + break; case 'q': //options->verbosity = 0; break;