shithub: alienpatch

Download patch

ref: f5516e57ec8a9eb3ccf0f526c8b1b3a612a5f86a
parent: 3af6f124c7d2c858c252c839ec043ffd7a4a5f7a
author: qwx <qwx@sciops.net>
date: Tue Dec 20 10:37:08 EST 2022

add ft2-globalvol: adjust global volume with more accessible media keys

--- /dev/null
+++ b/ft2-globalvol
@@ -1,0 +1,31 @@
+diff fde50d93b2284178743a12e8c359286ea99f0b21 uncommitted
+--- a/src/ft2_keyboard.c
++++ b/src/ft2_keyboard.c
+@@ -346,6 +346,27 @@
+ 		}
+ 		return;
+ 
++		case SDL_SCANCODE_VOLUMEUP:
++			if (config.masterVol <= 256-16)
++				config.masterVol += 16;
++			else
++				config.masterVol = 256;
++
++			setAudioAmp(config.boostLevel, config.masterVol, !!(config.specialFlags & BITDEPTH_32));
++			if (ui.configScreenShown && editor.currConfigScreen == CONFIG_SCREEN_IO_DEVICES)
++				showConfigScreen();
++			break;
++		case SDL_SCANCODE_VOLUMEDOWN:
++			if (config.masterVol >= 16)
++				config.masterVol -= 16;
++			else
++				config.masterVol = 0;
++
++			setAudioAmp(config.boostLevel, config.masterVol, !!(config.specialFlags & BITDEPTH_32));
++			if (ui.configScreenShown && editor.currConfigScreen == CONFIG_SCREEN_IO_DEVICES)
++				showConfigScreen();
++			break;
++
+ 		default: break;
+ 	}
+