From 9307e54f1d8a2be84d8c3ccd44e9539fe112bdb4 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Wed, 10 May 2023 16:33:01 +0800 Subject: [PATCH] OSD: reflect global volume status when changed by keyboard. --- menu.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/menu.cpp b/menu.cpp index 26587e1..04b088d 100644 --- a/menu.cpp +++ b/menu.cpp @@ -958,6 +958,7 @@ void HandleUI(void) static char addon[1024]; static int store_name; static int vfilter_type; + static int old_volume = 0; static char cp_MenuCancel; @@ -3488,9 +3489,9 @@ void HandleUI(void) } OsdWrite(12, s, menusub == 1); - m = get_volume(); + old_volume = get_volume(); strcpy(s, " Global Volume: "); - if (m & 0x10) + if (old_volume & 0x10) { strcat(s, "< Mute >"); } @@ -3500,7 +3501,7 @@ void HandleUI(void) char *bar = s + strlen(s); int vol = (audio_filter_en() < 0) ? get_core_volume() : 0; memset(bar, 0x8C, 8 - vol); - memset(bar, 0x7f, 8 - vol - m); + memset(bar, 0x7f, 8 - vol - old_volume); } OsdWrite(13, s, menusub == 2); @@ -3581,6 +3582,13 @@ void HandleUI(void) break; } } + + m = get_volume(); + if (old_volume != m) + { + old_volume = m; + menustate = MENU_MISC1; + } break; case MENU_JOYRESET: