INI option to enable volume control.

This commit is contained in:
sorgelig
2018-06-21 04:53:58 +08:00
parent 0cab5a60dd
commit fa4422fc2e
4 changed files with 7 additions and 0 deletions

View File

@@ -6,7 +6,9 @@ composite_sync=0 ; set to 1 for composite sync on HSync signal of VGA outp
vga_scaler=0 ; set to 1 to connect VGA to scaler output.
hdmi_audio_96k=0 ; set to 1 for 96khz/16bit HDMI audio (48khz/16bit otherwise)
keyrah_mode=0x18d80002 ; VIDPID of keyrah for special code translation (0x23418037 for Arduino Micro)
volumectl=1 ; enable audio volume control by multimedia keys
;bootscreen=0 ; uncomment to disable boot screen of some cores like Minimig.
;mouse_throttle=10 ; 1-100 mouse speed divisor. Useful for very sensitive mouses
; USER button emulation by keybaord. Usually it's reset button.
; 0 - lctrl+lalt+ralt (lctrl+lgui+rgui on keyrah)

View File

@@ -39,6 +39,7 @@ const ini_var_t ini_vars[] = {
{ "KBD_NOMOUSE", (void*)(&(cfg.kbd_nomouse)), UINT8, 0, 1, 1 },
{ "MOUSE_THROTTLE", (void*)(&(cfg.mouse_throttle)), UINT8, 1, 100, 1 },
{ "BOOTSCREEN", (void*)(&(cfg.bootscreen)), UINT8, 0, 1, 1 },
{ "VOLUMECTL", (void*)(&(cfg.volumectl)), UINT8, 0, 1, 1 },
};
// mist ini config

1
cfg.h
View File

@@ -28,6 +28,7 @@ typedef struct {
uint8_t kbd_nomouse;
uint8_t mouse_throttle;
uint8_t bootscreen;
uint8_t volumectl;
char video_conf[1024];
} cfg_t;

View File

@@ -424,6 +424,7 @@ void user_io_init(const char *path)
parse_video_mode();
FileLoadConfig("Volume.dat", &vol_att, 1);
vol_att &= 0x1F;
if (!cfg.volumectl) vol_att = 0;
spi_uio_cmd8(UIO_AUDVOL, vol_att);
user_io_send_buttons(1);
@@ -1896,6 +1897,8 @@ void user_io_osd_key_enable(char on)
static void set_volume(int cmd)
{
if (!cfg.volumectl) return;
vol_set_timeout = GetTimer(1000);
vol_att &= 0x17;