diff --git a/Changelog b/Changelog index 88df5ee..dcebc00 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,8 @@ Stable versions - Requires libxmp 4.4 - Add option to force tracker emulation - Add option to enable classic sound mixers + - Add command to switch between standard and classic mixers + - Add command to display current mixer type - Fix default amplification factor - Fix module-specific configuration file options - Remove option --offset-bug-emulation diff --git a/src/commands.c b/src/commands.c index 675b0c3..cad51e1 100644 --- a/src/commands.c +++ b/src/commands.c @@ -185,6 +185,9 @@ void read_command(xmp_context handle, struct xmp_module_info *mi, struct control ctl->loop++; ctl->loop %= 3; break; + case 'X': + ctl->cur_info = 'X'; + break; case 'x': { int f; @@ -209,7 +212,7 @@ void read_command(xmp_context handle, struct xmp_module_info *mi, struct control } break; } case 'Z': - ctl->cur_seq = 1; + ctl->cur_info = 'Z'; break; case 'z': ctl->explore ^= 1; diff --git a/src/common.h b/src/common.h index 7b6ab70..6ab15fb 100644 --- a/src/common.h +++ b/src/common.h @@ -67,7 +67,7 @@ struct control { int display; /* Info display flag */ int sequence; /* Current sequence */ int explore; /* Play all sequences */ - int cur_seq; /* Display current sequence */ + int cur_info; /* Display current sequence or mixer type */ int classic; /* Toggle classic mode */ int mixer_type; /* Mixer type (from player) */ }; diff --git a/src/info.c b/src/info.c index d0470de..d6948c8 100644 --- a/src/info.c +++ b/src/info.c @@ -27,9 +27,10 @@ void info_help(void) " h, ? Display available commands\n" " 1 - 0 Mute/unmute channels\n" " ! Unmute all channels\n" +" X Display current mixer type\n" +" x Enable classic mixers\n" " Z Display current sequence\n" " z Toggle subsong explorer mode\n" -" x Toggle classic mixers\n" " l Toggle loop mode\n" " m Display module information\n" " i Display combined instrument/sample list\n" @@ -124,7 +125,7 @@ void info_message(char *format, ...) va_list ap; va_start(ap, format); - msg_timer = 200000; + msg_timer = 300000; vsnprintf(msg_text, MSG_SIZE, format, ap); va_end(ap); } diff --git a/src/main.c b/src/main.c index 4bb0278..507095c 100644 --- a/src/main.c +++ b/src/main.c @@ -167,6 +167,41 @@ static void check_pause(xmp_context xc, struct control *ctl, } } +static void get_mixer_type(int t, struct options *opt, char *buf, size_t size) +{ + char *fmt; + + fmt = opt->format & XMP_FORMAT_MONO ? "mono" : "stereo"; + + switch (t) { + case XMP_MIXER_STANDARD: { + char *itp; + switch (opt->interp) { + case XMP_INTERP_NEAREST: + itp = "non-interpolated"; + break; + case XMP_INTERP_LINEAR: + itp = "linear interpolated"; + break; + case XMP_INTERP_SPLINE: + itp = "cubic spline interpolated"; + break; + default: + itp = "unknown interpolation"; + } + snprintf(buf, size, "Std %s %s mixer", fmt, itp); + break; } + case XMP_MIXER_A500: + snprintf(buf, size, "Amiga 500 %s modeling mixer", fmt); + break; + case XMP_MIXER_A500F: + snprintf(buf, size, "Amiga 500 %s with led filter", fmt); + break; + default: + snprintf(buf, size, "unknown %s mixer", fmt); + } +} + static void load_error(char *name, char *filename, int val) { char *msg; @@ -514,9 +549,18 @@ int main(int argc, char **argv) refresh_status = 1; } - if (control.cur_seq) { + + switch (control.cur_info) { + case 'X': { + char buf[80]; + get_mixer_type(control.mixer_type, &opt, buf, 80); + info_message("Mixer type: %s", buf); + control.cur_info = 0; + break; } + case 'Z': info_message("Current sequence: %d (start at position %02X)", control.sequence, mi.seq_data[control.sequence].entry_point); - control.cur_seq = 0; + control.cur_info = 0; + break; } } diff --git a/src/xmp.1 b/src/xmp.1 index f3fdf2c..c6bc16a 100644 --- a/src/xmp.1 +++ b/src/xmp.1 @@ -228,6 +228,10 @@ Mute/unmute channels 1 to 10\&. Unmute all channels\&. .IP "\fBh\fP, \fB?\fP" Display available commands\&. +.IP "\fBX\fP" +Display current mixer type\&. +.IP "\fBx\fP" +Enable classic mixers (if available)\&. .IP "\fBZ\fP" Display current sequence\&. .IP "\fBz\fP"