Add option to set the default pan amplitude

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 12 years ago
parent a7abbd30e3
commit 4acd98166a
  1. 3
      Changelog
  2. 2
      configure.ac
  3. 1
      src/common.h
  4. 3
      src/main.c
  5. 11
      src/options.c
  6. 8
      src/xmp.1

@ -1,6 +1,9 @@
Stable versions
---------------
4.0.9:
- Add option '-p' to set the default pan amplitude
4.0.8 (20140714):
- Add command 'c' to display module comment
- Add command-line option -C to display module comment

@ -28,7 +28,7 @@ esac
AC_PROG_INSTALL
AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax])
PKG_CHECK_MODULES([libxmp], [libxmp >= 4.1])
PKG_CHECK_MODULES([libxmp], [libxmp >= 4.3])
dnl Don't use things like /usr/etc or /usr/var

@ -24,6 +24,7 @@ struct options {
int format; /* sample format */
int max_time; /* max. replay time */
int mix; /* channel separation */
int defpan; /* default pan */
int interp; /* interpolation type */
int dsp; /* dsp effects */
int loop; /* loop module */

@ -221,6 +221,7 @@ int main(int argc, char **argv)
opt.verbose = 1;
opt.rate = 44100;
opt.mix = -1;
opt.defpan = 100;
opt.driver_id = NULL;
opt.interp = XMP_INTERP_SPLINE;
opt.dsp = XMP_DSP_LOWPASS;
@ -333,6 +334,8 @@ int main(int argc, char **argv)
argv[optind], optind - first + 1, argc - first);
}
xmp_set_player(xc, XMP_PLAYER_DEFPAN, opt.defpan);
/* load module */
val = xmp_load_module(xc, argv[optind]);

@ -90,6 +90,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"
" -p --default-pan Percentual default pan setting\n"
" -r --reverse Reverse left/right stereo channels\n"
" -u --unsigned Set the mixer to use unsigned samples\n"
"\nEnvironment options:\n"
@ -109,6 +110,7 @@ static const struct option lopt[] = {
{ "amplify", 1, 0, 'a' },
{ "bits", 1, 0, 'b' },
{ "driver", 1, 0, 'd' },
{ "default-pan", 1, 0, 'p' },
{ "fix-sample-loops", 0, 0, OPT_FIXLOOP },
{ "frequency", 1, 0, 'f' },
{ "help", 0, 0, 'h' },
@ -151,7 +153,7 @@ void get_options(int argc, char **argv, struct options *options)
int optidx = 0;
int o;
#define OPTIONS "a:b:CcD:d:Ff:hI:i:LlM:mNo:P:qRrS:s:T:t:uVvZz:"
#define OPTIONS "a:b:CcD:d:Ff:hI:i:LlM:mNo:P:p:qRrS:s:T:t:uVvZz:"
while ((o = getopt_long(argc, argv, OPTIONS, lopt, &optidx)) != -1) {
switch (o) {
case 'a':
@ -249,6 +251,13 @@ void get_options(int argc, char **argv, struct options *options)
if (options->mix > 100)
options->mix = 100;
break;
case 'p':
options->defpan = strtoul(optarg, NULL, 0);
if (options->defpan < 0)
options->defpan = 0;
if (options->defpan > 100)
options->defpan = 100;
break;
case OPT_PROBEONLY:
options->probeonly = 1;
break;

@ -1,4 +1,4 @@
.TH "XMP" "1" "Version 4\&.0\&.8" "Jul 2014" "Extended Module Player"
.TH "XMP" "1" "Version 4\&.0\&.9" "Ago 2014" "Extended Module Player"
.PP
.SH "NAME"
xmp - Extended Module Player
@ -27,7 +27,8 @@ xmp - Extended Module Player
[\fB\-\-nocmd\fP]
[\fB\-o, \-\-output\-file\fP \fIfilename\fP]
[\fB\-\-offset\-bug\-emulation\fP]
[\fB\-P, \-\-pan\fP \fIpan\fP]
[\fB\-P, \-\-pan\fP \fInum\fP]
[\fB\-p, \-\-default\-pan\fP \fInum\fP]
[\fB\-\-probe\-only\fP]
[\fB\-q, \-\-quiet\fP]
[\fB\-R, \-\-random\fP]
@ -107,6 +108,9 @@ given as the file name, the output will be sent to stdout\&.
Emulate Protracker 2.x handling of effect 0x09 (set sample offset)\&.
.IP "\fB\-P, \-\-pan\fP \fInum\fP"
Set the percentual panning amplitude\&.
.IP "\fB\-P, \-\-default\-pan\fP \fInum\fP"
Set the percentual default pan setting for modules that don\'t set their
own pan values\&. Useful to reduce LRRL pan separation on headphones\&.
.IP "\fB\-\-probe\-only\fP"
Exit after probing the audio device\&.
.IP "\fB\-R, \-\-random\fP"

Loading…
Cancel
Save