Adding directly settable commands (instead of volume up/down, set volume to xx)

This commit is contained in:
2026-01-30 17:20:57 -06:00
parent 87ece7eb14
commit 936f71b737
6 changed files with 264 additions and 115 deletions

View File

@@ -506,20 +506,22 @@ const char *ProgramName(uint8_t val) {
// db = 0.5634 x - 112.11
// for values 200 to 255
// db = 0.5 x - 99.5
// Single Linear
// Single Linear according to the manual
// db = 0.5574 x - 111.45
// Single Linear according to the on-screen display of Volume
// db = 0.5 x - 99.5
//
const char *VolumeDB(uint8_t val) {
static char buf[16];
float m, b;
if (val < 200) {
m = 0.5634f;
b = -112.11f;
} else {
//if (val < 200) {
// m = 0.5634f;
// b = -112.11f;
//} else {
m = 0.5f;
b = -99.5f;
}
//}
float db = m * val + b;
sprintf_s(buf, sizeof(buf), "%+3.1f db", db);
return buf;