shithub: alienpatch

Download patch

ref: 85a22730dfc0b6c3e4de7c44517939f2ac3ed66d
parent: 35c56195133e4217344b326bdd2b37f52f128d9b
author: qwx <qwx@sciops.net>
date: Sun Nov 27 04:38:27 EST 2022

ft2-clone: volume up/down keys hack

--- a/ft2-clone-latest-and-midi
+++ b/ft2-clone-latest-and-midi
@@ -235,6 +235,36 @@
  
  #ifndef _MSC_VER
  	SetProcessDPIAware();
+--- 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;
+ 	}
+ 
 --- a/src/ft2_midi.c
 +++ b/src/ft2_midi.c
 @@ -285,7 +285,10 @@