Display current mixer type

There was a bug in the library that was preventing this to work. We fixed
that, but now we require at least libxmp a3b8005.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 10 years ago
parent d5f6343acf
commit faf54384e9
  1. 14
      src/commands.c
  2. 1
      src/common.h
  3. 30
      src/info.c
  4. 6
      src/main.c

@ -186,8 +186,20 @@ void read_command(xmp_context handle, struct xmp_module_info *mi, struct control
ctl->loop %= 3;
break;
case 'x': {
int f = xmp_get_player(handle, XMP_PLAYER_FLAGS);
int f;
ctl->classic = !ctl->classic;
f = xmp_get_player(handle, XMP_PLAYER_FLAGS);
if (ctl->classic) {
xmp_set_player(handle, XMP_PLAYER_FLAGS,
f | XMP_FLAGS_CLASSIC);
} else {
xmp_set_player(handle, XMP_PLAYER_FLAGS,
f &= ~XMP_FLAGS_CLASSIC);
}
f = xmp_get_player(handle, XMP_PLAYER_CFLAGS);
if (ctl->classic) {
xmp_set_player(handle, XMP_PLAYER_CFLAGS,
f | XMP_FLAGS_CLASSIC);

@ -69,6 +69,7 @@ struct control {
int explore; /* Play all sequences */
int cur_seq; /* Display current sequence */
int classic; /* Toggle classic mode */
int mixer_type; /* Mixer type (from player) */
};
extern struct player_mode pmode[];

@ -134,6 +134,7 @@ void info_frame(struct xmp_module_info *mi, struct xmp_frame_info *fi, struct co
static int ord = -1, spd = -1, bpm = -1;
char rowstr[3], numrowstr[3];
int time;
char x;
if (fi->virt_used > max_channels)
max_channels = fi->virt_used;
@ -143,16 +144,34 @@ void info_frame(struct xmp_module_info *mi, struct xmp_frame_info *fi, struct co
time = fi->time / 100;
/* Show mixer type */
x = ' ';
if (ctl->classic) {
switch (ctl->mixer_type) {
case XMP_MIXER_STANDARD:
x = 's';
break;
case XMP_MIXER_A500:
x = 'A';
break;
case XMP_MIXER_A500F:
x = 'F';
break;
default:
x = 'x';
}
}
if (msg_timer > 0) {
report("\r%-61.61s %c%c%c", msg_text,
ctl->explore ? 'Z' : ' ',
ctl->loop ? 'L' : ' ',
ctl->loop > 1 ? '*' : ' ');
ctl->loop ? 'L' : ' ', x);
msg_timer -= fi->frame_time * fi->speed / 6;
if (msg_timer == 0)
if (msg_timer == 0) {
msg_timer--;
else
} else {
goto print_time;
}
}
if (msg_timer < 0) {
@ -186,8 +205,7 @@ void info_frame(struct xmp_module_info *mi, struct xmp_frame_info *fi, struct co
report("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
"%2.2s/%2.2s] Chn[%02X/%02X] %c%c%c",
rowstr, numrowstr, fi->virt_used, max_channels,
ctl->explore ? 'Z' : ' ', ctl->loop ? 'L' : ' ',
ctl->classic ? 'X' : ' ');
ctl->explore ? 'Z' : ' ', ctl->loop ? 'L' : ' ', x);
print_time:

@ -155,9 +155,9 @@ static void check_pause(xmp_context xc, struct control *ctl,
usleep(100000);
read_command(xc, mi, ctl);
if (ctl->display) {
int mode = xmp_get_player(xc, XMP_PLAYER_MODE);
show_info(ctl->display, mi, mode);
if (verbose) {
int mode = xmp_get_player(xc, XMP_PLAYER_MODE);
show_info(ctl->display, mi, mode);
info_frame(mi, fi, ctl, 1);
}
ctl->display = 0;
@ -475,6 +475,8 @@ int main(int argc, char **argv)
int old_loop = fi.loop_count;
xmp_get_frame_info(xc, &fi);
control.mixer_type = xmp_get_player(
xc, XMP_PLAYER_MIXER_TYPE);
/* Check loop */

Loading…
Cancel
Save