From 848fc4db005783200d2006164777239d27de4dca Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Fri, 15 Jul 2016 17:54:21 -0300 Subject: [PATCH] Change command line parameter name from classic to amiga Signed-off-by: Claudio Matsuoka --- src/commands.c | 16 ++++++++-------- src/common.h | 4 ++-- src/info.c | 6 +++--- src/main.c | 4 ++-- src/modules.conf | 2 +- src/options.c | 12 ++++++------ src/read_config.c | 4 ++-- src/xmp.conf | 9 ++++----- 8 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/commands.c b/src/commands.c index 8b5acf4..fc10926 100644 --- a/src/commands.c +++ b/src/commands.c @@ -188,29 +188,29 @@ void read_command(xmp_context handle, struct xmp_module_info *mi, struct control case 'X': ctl->cur_info = 'X'; break; - case 'x': { + case 'a': { int f; - ctl->classic = !ctl->classic; + ctl->amiga = !ctl->amiga; /* set player flags */ f = xmp_get_player(handle, XMP_PLAYER_FLAGS); - if (ctl->classic) { + if (ctl->amiga) { xmp_set_player(handle, XMP_PLAYER_FLAGS, - f | XMP_FLAGS_CLASSIC); + f | XMP_FLAGS_A500); } else { xmp_set_player(handle, XMP_PLAYER_FLAGS, - f &= ~XMP_FLAGS_CLASSIC); + f &= ~XMP_FLAGS_A500); } /* set current module flags */ f = xmp_get_player(handle, XMP_PLAYER_CFLAGS); - if (ctl->classic) { + if (ctl->amiga) { xmp_set_player(handle, XMP_PLAYER_CFLAGS, - f | XMP_FLAGS_CLASSIC); + f | XMP_FLAGS_A500); } else { xmp_set_player(handle, XMP_PLAYER_CFLAGS, - f &= ~XMP_FLAGS_CLASSIC); + f &= ~XMP_FLAGS_A500); } break; } case 'Z': diff --git a/src/common.h b/src/common.h index 2156cd3..247bf77 100644 --- a/src/common.h +++ b/src/common.h @@ -52,7 +52,7 @@ struct options { int explore; /* play all sequences in module */ int show_comment; /* show module comment text */ int player_mode; /* force tracker emulation */ - int classic; /* enable classic mixers */ + int amiga; /* enable amiga mixer */ char *driver_id; /* sound driver ID */ char *out_file; /* output file name */ char *ins_path; /* instrument path */ @@ -69,7 +69,7 @@ struct control { int sequence; /* Current sequence */ int explore; /* Play all sequences */ int cur_info; /* Display current sequence or mixer type */ - int classic; /* Toggle classic mode */ + int amiga; /* Toggle amiga mixer mode */ int mixer_type; /* Mixer type (from player) */ }; diff --git a/src/info.c b/src/info.c index 7897087..8c0e53e 100644 --- a/src/info.c +++ b/src/info.c @@ -28,7 +28,7 @@ void info_help(void) " 1 - 0 Mute/unmute channels\n" " ! Unmute all channels\n" " X Display current mixer type\n" -" x Enable classic mixers\n" +" a Enable amiga mixer\n" " Z Display current sequence\n" " z Toggle subsong explorer mode\n" " l Toggle loop mode\n" @@ -159,10 +159,10 @@ void info_frame(struct xmp_module_info *mi, struct xmp_frame_info *fi, struct co /* Show mixer type */ x = ' '; - if (ctl->classic) { + if (ctl->amiga) { switch (ctl->mixer_type) { case XMP_MIXER_STANDARD: - x = 's'; + x = '-'; break; case XMP_MIXER_A500: x = 'A'; diff --git a/src/main.c b/src/main.c index d9e871d..925e0bf 100644 --- a/src/main.c +++ b/src/main.c @@ -368,7 +368,7 @@ int main(int argc, char **argv) control.loop = opt.loop; control.explore = opt.explore; - control.classic = opt.classic; + control.amiga = opt.amiga; first = optind; play_all: @@ -483,7 +483,7 @@ int main(int argc, char **argv) set_flag(flags, opt.vblank, XMP_FLAGS_VBLANK); set_flag(flags, opt.fx9bug, XMP_FLAGS_FX9BUG); set_flag(flags, opt.fixloop, XMP_FLAGS_FIXLOOP); - set_flag(flags, control.classic, XMP_FLAGS_CLASSIC); + set_flag(flags, control.amiga, XMP_FLAGS_A500); xmp_set_player(xc, XMP_PLAYER_CFLAGS, flags); /* Show module data */ diff --git a/src/modules.conf b/src/modules.conf index 4423aa1..7682071 100644 --- a/src/modules.conf +++ b/src/modules.conf @@ -6,7 +6,7 @@ # # [MD5sum] # amplify = <0|1|2|3> Amplification factor (default is 1) -# classic = yes/no Enable classic mixer if available +# amiga = yes/no Enable Amiga simulation mixer if available # filter = yes/no Enable filters (affects IT only) # fixloop = yes/no Use sample loop start value / 2 # interpolation = Software mixer interpolation diff --git a/src/options.c b/src/options.c index e5fa9a0..5476902 100644 --- a/src/options.c +++ b/src/options.c @@ -101,6 +101,7 @@ static void usage(char *s, struct options *options) " -Z --all-sequences Play all sequences (subsongs) in module\n" " -z --sequence num Play the specified sequence (0=main)\n" "\nMixer options:\n" +" -A --amiga Use Paula simulation mixer in Amiga formats\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" @@ -116,7 +117,6 @@ static void usage(char *s, struct options *options) " -p --default-pan Percentual default pan setting (default %d%%)\n" " -r --reverse Reverse left/right stereo channels\n" " -u --unsigned Set the mixer to use unsigned samples\n" -" -x --classic Use classic mixer (if available for format)\n" "\nEnvironment options:\n" " -I --instrument-path Set pathname to external samples\n" "\nInformation options:\n" @@ -132,9 +132,9 @@ static void usage(char *s, struct options *options) } static const struct option lopt[] = { + { "amiga", 0, 0, 'A' }, { "amplify", 1, 0, 'a' }, { "bits", 1, 0, 'b' }, - { "classic", 0, 0, 'x' }, { "driver", 1, 0, 'd' }, { "default-pan", 1, 0, 'p' }, { "fix-sample-loops", 0, 0, OPT_FIXLOOP }, @@ -182,9 +182,12 @@ void get_options(int argc, char **argv, struct options *options) int optidx = 0; int o; -#define OPTIONS "a:b:CcD:d:e:Ff:hI:i:LlM:mNo:P:p:qRrS:s:T:t:uVvxZz:" +#define OPTIONS "Aa:b:CcD:d:e: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': + options->amiga = 1; + break; case 'a': options->amplify = atoi(optarg); break; @@ -360,9 +363,6 @@ void get_options(int argc, char **argv, struct options *options) case 'v': options->verbose++; break; - case 'x': - options->classic = 1; - break; case 'Z': options->explore = 1; break; diff --git a/src/read_config.c b/src/read_config.c index 0025bd4..6b2c211 100644 --- a/src/read_config.c +++ b/src/read_config.c @@ -122,7 +122,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); + getval_yn("amiga", o->amiga, 1); if (!strcmp(var, "driver")) { strncpy(driver, val, 31); @@ -241,7 +241,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); + getval_tristate("amiga", o->amiga); if (!strcmp(var, "interpolation")) { if (!strcmp(val, "nearest")) { diff --git a/src/xmp.conf b/src/xmp.conf index 961fcf8..08166a0 100644 --- a/src/xmp.conf +++ b/src/xmp.conf @@ -72,12 +72,11 @@ # #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. +# amiga = +# Enable Amiga simulation mixer for Amiga 4-channel modules. The mixer is +# modeled after an Amiga 500 with led filter option. Default is disabled. # -#classic = no +#amiga = no # srate = # Sampling rate in hertz. Default is 44100 Hz.