[xmp] Allow module configuration to override default module quirks

Libxmp 4.0.3 includes built-in module quirks for well-known cases. Allow
modules.conf to override these default settings.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 13 years ago
parent ac2956ee8f
commit 7bc0c45b59
  1. 3
      Changelog
  2. 4
      src/common.h
  3. 18
      src/main.c
  4. 11
      src/read_config.c

@ -3,6 +3,9 @@ Stable versions
4.0.2 ():
- Fix data type in coreaudio driver
- Allow modules.conf to override default module quirks when
using libxmp 4.0.3 or newer
- Don't rescan module if using libxmp 4.0.3 or newer
Changes by Jan Engelhardt:
- give Pulseaudio higher priority than ALSA

@ -15,7 +15,9 @@ struct options {
int loop; /* loop module */
int random; /* play in random order */
int reverse; /* reverse stereo channels */
int flags; /* player flags */
int vblank; /* vblank flag */
int fx9bug; /* fx9bug flag */
int fixloop; /* fixloop flag */
int verbose; /* verbosity level */
int silent; /* silent output */
int info; /* display information and exit */

@ -169,6 +169,7 @@ int main(int argc, char **argv)
#ifndef WIN32
struct timeval tv;
struct timezone tz;
int flags;
gettimeofday(&tv, &tz);
srand(tv.tv_usec);
@ -355,10 +356,23 @@ int main(int argc, char **argv)
/* Set player flags */
xmp_set_player(xc, XMP_PLAYER_FLAGS, opt.flags);
if (opt.flags & XMP_FLAGS_VBLANK) {
#define set_flag(x,y,z) do { \
if ((y) > 0) (x) |= (z); \
else if ((y) < 0) (x) &= ~ (z); \
} while (0)
flags = xmp_get_player(xc, XMP_PLAYER_FLAGS);
set_flag(flags, opt.vblank, XMP_FLAGS_VBLANK);
set_flag(flags, opt.fx9bug, XMP_FLAGS_FX9BUG);
set_flag(flags, opt.fixloop, XMP_FLAGS_FIXLOOP);
xmp_set_player(xc, XMP_PLAYER_FLAGS, flags);
#if XMP_VERCODE < 0x040003
if (flags & XMP_FLAGS_VBLANK) {
xmp_scan_module(xc);
}
#endif
/* Show module data */

@ -98,6 +98,10 @@ int read_config(struct options *o)
if (!strcmp(var,x)) { if (get_yesno (val)) w |= (y); \
else w &= ~(y); continue; } }
#define getval_tristate(x,w) { \
if (!strcmp(var,x)) { if (get_yesno (val)) w = 1; \
else w = -1; continue; } }
#define getval_no(x,y) { \
if (!strcmp(var,x)) { y = atoi (val); continue; } }
@ -221,9 +225,10 @@ static void parse_modconf(struct options *o, char *confname, unsigned char *md5)
getval_yn("reverse", o->reverse, 1);
getval_no("amplify", o->amplify);
getval_no("mix", o->mix);
getval_yn("fixloop", o->flags, XMP_FLAGS_FIXLOOP);
getval_yn("fx9bug", o->flags, XMP_FLAGS_FX9BUG);
getval_yn("vblank", o->flags, XMP_FLAGS_VBLANK);
getval_tristate("fixloop", o->fixloop);
getval_tristate("fx9bug", o->fx9bug);
getval_tristate("vblank", o->vblank);
if (!strcmp(var, "interpolation")) {
if (!strcmp(val, "nearest")) {

Loading…
Cancel
Save