Add command to display current mixer type

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 10 years ago
parent faf54384e9
commit 0e6afbdcea
  1. 2
      Changelog
  2. 5
      src/commands.c
  3. 2
      src/common.h
  4. 5
      src/info.c
  5. 48
      src/main.c
  6. 4
      src/xmp.1

@ -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

@ -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;

@ -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) */
};

@ -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);
}

@ -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;
}
}

@ -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"

Loading…
Cancel
Save