[xmp] Add --probe-only option

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 14 years ago
parent 73d0f2229d
commit 932ca50b08
  1. 1
      src/common.h
  2. 5
      src/main.c
  3. 7
      src/options.c

@ -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 */

@ -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]);

@ -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;

Loading…
Cancel
Save