From 58e231112215d5326b501a4ef902bfc7addb7ff4 Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Sat, 11 Jun 2016 18:06:21 -0300 Subject: [PATCH] Fix module specific configuration file Signed-off-by: Claudio Matsuoka --- Changelog | 1 + src/modules.conf | 3 ++- src/read_config.c | 14 +++++++++++--- src/xmp.1 | 4 ++-- src/xmp.conf | 10 +++++++++- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index 930ab5d..88df5ee 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ Stable versions - Add option to force tracker emulation - Add option to enable classic sound mixers - Fix default amplification factor + - Fix module-specific configuration file options - Remove option --offset-bug-emulation 4.0.11 (20160306): diff --git a/src/modules.conf b/src/modules.conf index 84f3df9..e79cac7 100644 --- a/src/modules.conf +++ b/src/modules.conf @@ -5,11 +5,12 @@ # Format is: # # [MD5sum] -# 8bit = yes/no Convert 16 bit samples to 8 bit # amplify = <0|1|2|3> Amplification factor (default is 1) +# classic = yes/no Enable classic mixer if available # filter = yes/no Enable filters (affects IT only) # fixloop = yes/no Use sample loop start value / 2 # interpolation = Software mixer interpolation +# loop = yes/no Loop module # mode = Force tracker emulation # mono = yes/no Mono output # mix = value Stereo channel separation (0 - 100) diff --git a/src/read_config.c b/src/read_config.c index 6f311fe..6933e08 100644 --- a/src/read_config.c +++ b/src/read_config.c @@ -121,6 +121,7 @@ int read_config(struct options *o) getval_no("srate", o->rate); /*getval_no("time", o->time); getval_no("verbosity", o->verbosity);*/ + getval_yn("classic", o->classic, 1); if (!strcmp(var, "driver")) { strncpy(driver, val, 31); @@ -192,6 +193,7 @@ static void parse_modconf(struct options *o, char *confname, unsigned char *md5) char *hash, *var, *val, line[256]; struct player_mode *pm; int active = 0; + int mono = 0; if ((rc = fopen(confname, "r")) == NULL) return; @@ -227,10 +229,9 @@ static void parse_modconf(struct options *o, char *confname, unsigned char *md5) val = strtok(NULL, " \t\n"); - getval_yn("8bit", o->format, XMP_FORMAT_8BIT); - getval_yn("mono", o->format, XMP_FORMAT_MONO); getval_yn("filter", o->dsp, XMP_DSP_LOWPASS); - getval_yn("loop", o->loop, XMP_DSP_LOWPASS); + getval_yn("loop", o->loop, 1); + getval_yn("mono", mono, 1); getval_yn("reverse", o->reverse, 1); getval_no("amplify", o->amplify); getval_no("mix", o->mix); @@ -238,6 +239,7 @@ static void parse_modconf(struct options *o, char *confname, unsigned char *md5) getval_tristate("fixloop", o->fixloop); getval_tristate("fx9bug", o->fx9bug); getval_tristate("vblank", o->vblank); + getval_tristate("classic", o->classic); if (!strcmp(var, "interpolation")) { if (!strcmp(val, "nearest")) { @@ -262,6 +264,12 @@ static void parse_modconf(struct options *o, char *confname, unsigned char *md5) "\"%s\"\n", confname, val); } } + + fprintf(stderr, "%s: unknown option \"%s\"\n", confname, var); + } + + if (mono) { + o->mix = 0; } fclose(rc); diff --git a/src/xmp.1 b/src/xmp.1 index 0ae9707..b618683 100644 --- a/src/xmp.1 +++ b/src/xmp.1 @@ -146,8 +146,8 @@ verbosity level will be increased (no messages will be displayed when the player runs in background)\&. .IP "\fB\-x, \-\-classic\fP" Use classic sound mixers\&, if available for the format being played\&. -For Amiga formats such as Protracker, classic mode simulates the sound -of an Amiga 500\&, with or without the led filter\&. +For Amiga formats such as Protracker, the classic mode mixer models the +sound of an Amiga 500\&, with or without the led filter\&. .IP "\fB\-Z, \-\-all\-sequences\fP" Play all hidden or alternative pattern sequences (subsongs) in module\&. .IP "\fB\-z, \-\-sequence\fP \fInum\fP" diff --git a/src/xmp.conf b/src/xmp.conf index 9fda081..0fb43fc 100644 --- a/src/xmp.conf +++ b/src/xmp.conf @@ -72,6 +72,13 @@ # #amplify = 1 +# classic = +# Enable classic mixer if available. For Amiga 4-channel modules, the +# classic mixer is modeled after an Amiga 500 with led filter option. +# Default is disabled. +# +#classic = no + # srate = # Sampling rate in hertz. Default is 44100 Hz. # @@ -135,6 +142,7 @@ #mix = 70 # default_pan = -# Default pan setting for 4-channel Amiga modules. Default is 50% +# Default pan setting for modules with L/R channels. Default is 50% +# (does not affect the Amiga classic mixer) # #default_pan = 50