Support for custom audio filters.
This commit is contained in:
87
user_io.cpp
87
user_io.cpp
@@ -32,16 +32,13 @@
|
||||
#include "miniz.h"
|
||||
#include "cheats.h"
|
||||
#include "video.h"
|
||||
#include "audio.h"
|
||||
|
||||
#include "support.h"
|
||||
|
||||
static char core_path[1024] = {};
|
||||
static char rbf_path[1024] = {};
|
||||
|
||||
static uint8_t vol_att = 0;
|
||||
static uint8_t corevol_att = 0;
|
||||
unsigned long vol_set_timeout = 0;
|
||||
|
||||
static fileTYPE sd_image[4] = {};
|
||||
static uint64_t buffer_lba[4] = { ULLONG_MAX,ULLONG_MAX,ULLONG_MAX,ULLONG_MAX };
|
||||
|
||||
@@ -766,15 +763,7 @@ void user_io_init(const char *path, const char *xml)
|
||||
|
||||
video_mode_load();
|
||||
if(strlen(cfg.font)) LoadFont(cfg.font);
|
||||
|
||||
FileLoadConfig("Volume.dat", &vol_att, 1);
|
||||
if (!is_menu())
|
||||
{
|
||||
static char cfg_name[128];
|
||||
sprintf(cfg_name, "%s_volume.cfg", user_io_get_core_name_ex());
|
||||
FileLoadConfig(cfg_name, &corevol_att, 1);
|
||||
}
|
||||
send_volume();
|
||||
load_volume();
|
||||
|
||||
user_io_send_buttons(1);
|
||||
|
||||
@@ -2665,15 +2654,7 @@ void user_io_poll()
|
||||
reboot(1);
|
||||
}
|
||||
|
||||
if (vol_set_timeout && CheckTimer(vol_set_timeout))
|
||||
{
|
||||
vol_set_timeout = 0;
|
||||
FileSaveConfig("Volume.dat", &vol_att, 1);
|
||||
|
||||
static char cfg_name[128];
|
||||
sprintf(cfg_name, "%s_volume.cfg", user_io_get_core_name_ex());
|
||||
FileSaveConfig(cfg_name, &corevol_att, 1);
|
||||
}
|
||||
save_volume();
|
||||
|
||||
if (diskled_is_on && CheckTimer(diskled_timer))
|
||||
{
|
||||
@@ -2958,68 +2939,6 @@ void user_io_osd_key_enable(char on)
|
||||
input_switch(-1);
|
||||
}
|
||||
|
||||
void send_volume()
|
||||
{
|
||||
get_volume();
|
||||
get_core_volume();
|
||||
if (!(vol_att & 0x10) && vol_att + corevol_att > 7) vol_att = 7 - corevol_att;
|
||||
spi_uio_cmd8(UIO_AUDVOL, vol_att + corevol_att);
|
||||
}
|
||||
|
||||
int get_volume()
|
||||
{
|
||||
return vol_att & 0x17;
|
||||
}
|
||||
|
||||
int get_core_volume()
|
||||
{
|
||||
corevol_att &= 7;
|
||||
if (corevol_att > 6) corevol_att = 6;
|
||||
return corevol_att;
|
||||
}
|
||||
|
||||
void set_volume(int cmd)
|
||||
{
|
||||
vol_set_timeout = GetTimer(1000);
|
||||
|
||||
vol_att &= 0x17;
|
||||
if(!cmd) vol_att ^= 0x10;
|
||||
else if (vol_att & 0x10) vol_att &= 0xF;
|
||||
else if (cmd < 0 && vol_att < 7) vol_att += 1;
|
||||
else if (cmd > 0 && vol_att > 0) vol_att -= 1;
|
||||
|
||||
send_volume();
|
||||
|
||||
if (vol_att & 0x10)
|
||||
{
|
||||
Info("\x8d Mute", 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
char str[32];
|
||||
memset(str, 0, sizeof(str));
|
||||
|
||||
sprintf(str, "\x8d ");
|
||||
char *bar = str + strlen(str);
|
||||
|
||||
int vol = get_core_volume();
|
||||
memset(bar, 0x8C, 8 - vol);
|
||||
memset(bar, 0x7f, 8 - vol - vol_att);
|
||||
Info(str, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
void set_core_volume(int cmd)
|
||||
{
|
||||
vol_set_timeout = GetTimer(1000);
|
||||
|
||||
corevol_att &= 7;
|
||||
if (cmd < 0 && corevol_att < 6) corevol_att += 1;
|
||||
if (cmd > 0 && corevol_att > 0) corevol_att -= 1;
|
||||
|
||||
send_volume();
|
||||
}
|
||||
|
||||
void user_io_kbd(uint16_t key, int press)
|
||||
{
|
||||
if(is_menu()) spi_uio_cmd(UIO_KEYBOARD); //ping the Menu core to wakeup
|
||||
|
||||
Reference in New Issue
Block a user