From 044b479fc8a03b21c124754c417a2f359e2439bf Mon Sep 17 00:00:00 2001 From: Pavel Chuzov Date: Sat, 5 May 2018 04:37:24 +0700 Subject: [PATCH] Display some info in XMPlay window --- xmplay/xmp_vgmstream.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xmplay/xmp_vgmstream.c b/xmplay/xmp_vgmstream.c index edee12ce..eb26f6ce 100644 --- a/xmplay/xmp_vgmstream.c +++ b/xmplay/xmp_vgmstream.c @@ -331,9 +331,20 @@ char * WINAPI xmplay_GetTags() { void WINAPI xmplay_GetInfoText(char* format, char* length) { if (!format) return; + if (!vgmstream) + return; - sprintf(format,"vgmstream"); - /* length is the file time */ + int rate = vgmstream->sample_rate; + int samples = vgmstream->num_samples; + int bps = get_vgmstream_average_bitrate(vgmstream) / 1000; + char* fmt = get_vgmstream_coding_description(vgmstream->coding_type); + + int t = samples / rate; + int tmin = t / 60; + int tsec = t % 60; + + sprintf(format, "%s", fmt); + sprintf(length, "%d:%02d - %dKb/s - %dHz", tmin, tsec, bps, rate); } /* info for the "General" window/tab (buf is ~40K) */