From 9866b707ef79a9241427f75c163ecca7eaf252e3 Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Mon, 9 Apr 2012 15:18:02 -0300 Subject: [PATCH] [xmp] Add nocmd option Signed-off-by: Claudio Matsuoka --- src/common.h | 1 + src/main.c | 2 +- src/options.c | 15 ++++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/common.h b/src/common.h index 313b6a5..3d8558f 100644 --- a/src/common.h +++ b/src/common.h @@ -16,6 +16,7 @@ struct options { int silent; /* silent output */ int info; /* display information and exit */ int probeonly; /* probe sound driver and exit */ + int nocmd; /* disable interactive commands */ char *driver_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 f70e16e..2956813 100644 --- a/src/main.c +++ b/src/main.c @@ -311,7 +311,7 @@ int main(int argc, char **argv) sound->play(mi.buffer, mi.buffer_size); - if (!background) { + if (!background && !options.nocmd) { read_command(handle, &control); if (control.display) { diff --git a/src/options.c b/src/options.c index 5444113..2260620 100644 --- a/src/options.c +++ b/src/options.c @@ -67,22 +67,21 @@ static void usage(char *s) printf("\nPlayer control options:\n" " -D parameter[=val] Pass configuration parameter to the output driver\n" " -d --driver name Force output to the specified device\n" -" --offset-bug-emulation Emulate Protracker 2.x bug in effect 9\n" " -l --loop Enable module looping\n" " -M --mute ch-list Mute the specified channels\n" +" --nocmd Disable interactive commands\n" " -R --random Random order playing\n" " -S --solo ch-list Set channels to solo mode\n" " -s --start num Start from the specified order\n" " -t --time num Maximum playing time in seconds\n" -"\nPlayer sound options:\n" -" -m --mono Mono output\n" -" -P --pan pan Percentual pan separation\n" -"\nSoftware mixer options:\n" +"\nMixer options:\n" " -a --amplify {0|1|2|3} Amplification factor: 0=Normal, 1=x2, 2=x4, 3=x8\n" " -b --bits {8|16} Software mixer resolution (8 or 16 bits)\n" " -c --stdout Mix the module to stdout\n" " -f --frequency rate Sampling rate in hertz (default 44100)\n" +" -m --mono Mono output\n" " -o --output-file name Mix the module to file ('-' for stdout)\n" +" -P --pan pan Percentual pan separation\n" " -u --unsigned Set the mixer to use unsigned samples\n" "\nEnvironment options:\n" " -I --instrument-path Set pathname to external samples\n" @@ -92,7 +91,6 @@ static void usage(char *s) " -L --list-formats List supported module formats\n" " --probe-only Probe audio device and exit\n" " -q --quiet Quiet mode (verbosity level = 0)\n" -" --show-time Display elapsed and remaining time\n" " -V --version Print version information\n" " -v --verbose Verbose mode (incremental)\n"); } @@ -102,7 +100,6 @@ static struct option lopt[] = { { "bits", 1, 0, 'b' }, { "driver", 1, 0, 'd' }, { "frequency", 1, 0, 'f' }, - { "offset-bug-emulation", 0, 0, OPT_FX9BUG }, { "help", 0, 0, 'h' }, { "instrument-path", 1, 0, 'I' }, { "info", 0, 0, 'i' }, @@ -110,6 +107,7 @@ static struct option lopt[] = { { "loop", 0, 0, 'l' }, { "mono", 0, 0, 'm' }, { "mute", 1, 0, 'M' }, + { "nocmd", 0, 0, OPT_NOCMD }, { "output-file", 1, 0, 'o' }, { "pan", 1, 0, 'P' }, { "probe-only", 0, 0, OPT_PROBEONLY }, @@ -186,6 +184,9 @@ void get_options(int argc, char **argv, struct options *options) case 'n': options->silent = 1; break; + case OPT_NOCMD: + options->nocmd = 1; + break; case 'o': options->out_file = optarg; if (strlen(optarg) >= 4 &&