diff --git a/src/common.h b/src/common.h index ca511d1..f24a819 100644 --- a/src/common.h +++ b/src/common.h @@ -14,6 +14,7 @@ struct options { int dsp; /* dsp effects */ int loop; /* loop module */ int random; /* play in random order */ + int reverse; /* reverse stereo channels */ int verbose; int silent; /* silent output */ int info; /* display information and exit */ diff --git a/src/main.c b/src/main.c index 95e7f60..14a0e79 100644 --- a/src/main.c +++ b/src/main.c @@ -261,10 +261,6 @@ int main(int argc, char **argv) setenv("XMP_INSTRUMENT_PATH", options.ins_path, 1); } - if (options.mix >= 0) { - xmp_mixer_set(handle, XMP_MIXER_MIX, options.mix); - } - lf_flag = 0; for (first = optind; optind < argc; optind++) { if (options.verbose > 0) { @@ -315,6 +311,15 @@ int main(int argc, char **argv) xmp_mixer_set(handle, XMP_MIXER_INTERP, options.interp); xmp_mixer_set(handle, XMP_MIXER_DSP, options.dsp); + if (options.mix >= 0) { + xmp_mixer_set(handle, XMP_MIXER_MIX, options.mix); + } + + if (options.reverse) { + int mix = xmp_mixer_get(handle, XMP_MIXER_MIX); + xmp_mixer_set(handle, XMP_MIXER_MIX, -mix); + } + xmp_set_position(handle, options.start); /* Mute channels */ diff --git a/src/options.c b/src/options.c index d36d5b8..bbbb99e 100644 --- a/src/options.c +++ b/src/options.c @@ -83,6 +83,7 @@ static void usage(char *s) " -F --nofilter Disable IT lowpass filters\n" " -o --output-file name Mix the module to file ('-' for stdout)\n" " -P --pan pan Percentual pan separation\n" +" -r --reverse Reverse left/right stereo channels\n" " -u --unsigned Set the mixer to use unsigned samples\n" "\nEnvironment options:\n" " -I --instrument-path Set pathname to external samples\n" @@ -117,6 +118,7 @@ static struct option lopt[] = { { "load-only", 0, 0, OPT_LOADONLY }, { "quiet", 0, 0, 'q' }, { "random", 0, 0, 'R' }, + { "reverse", 0, 0, 'r' }, { "solo", 1, 0, 'S' }, { "start", 1, 0, 's' }, { "stdout", 0, 0, 'c' }, @@ -133,7 +135,7 @@ void get_options(int argc, char **argv, struct options *options) int optidx = 0; int o; -#define OPTIONS "a:b:cD:d:Ff:hI:i:LlM:mNo:P:qRS:s:T:t:uVv" +#define OPTIONS "a:b:cD:d:Ff:hI:i:LlM:mNo:P:qRrS:s:T:t:uVv" while ((o = getopt_long(argc, argv, OPTIONS, lopt, &optidx)) != -1) { switch (o) { case 'a': @@ -225,6 +227,9 @@ void get_options(int argc, char **argv, struct options *options) case 'R': options->random = 1; break; + case 'r': + options->reverse = 1; + break; case 'M': case 'S': if (o == 'S') {