fix eq param input

This commit is contained in:
ed 2021-06-17 00:29:14 +02:00
parent e08c03b886
commit d70981cdd1
2 changed files with 23 additions and 10 deletions

View file

@ -484,14 +484,21 @@ html.light #ggrid a.sel {
margin: .5em;
}
.opview input[type=text] {
color: #fff;
background: #383838;
color: #fff;
border: none;
box-shadow: 0 0 .3em #222;
border-bottom: 1px solid #fc5;
border-radius: .2em;
padding: .2em .3em;
}
.opview input.err {
background: #a20;
border-color: #f00;
box-shadow: 0 0 .7em #f00;
text-shadow: 1px 1px 0 #500;
outline: none;
}
input[type="checkbox"]+label {
color: #f5a;
}

View file

@ -648,14 +648,16 @@ var audio_eq = (function () {
fi.type = a == 0 ? 'lowshelf' : a == cfg.length - 1 ? 'highshelf' : 'peaking';
r.filters.push(fi);
}
for (var a = r.filters.length - 1; a >= 0; a--) {
r.filters[a].connect(a > 0 ? r.filters[a - 1] : mp.ac.destination);
}
// pregain, keep first in chain
fi = mp.ac.createGain();
fi.gain.value = r.amp + 0.94; // +.137 dB measured; now -.25 dB and almost bitperfect
mp.acs.connect(fi);
fi.connect(r.filters[r.filters.length - 1]);
r.filters.push(fi);
for (var a = r.filters.length - 1; a >= 0; a--)
r.filters[a].connect(a > 0 ? r.filters[a - 1] : mp.ac.destination);
mp.acs.connect(r.filters[r.filters.length - 1]);
}
function eq_step(e) {
@ -672,22 +674,26 @@ var audio_eq = (function () {
}
function adj_band(that, step) {
var err = false;
try {
var band = parseInt(that.getAttribute('band')),
v = parseFloat(that.value);
vs = that.value,
v = parseFloat(vs);
if (isNaN(v))
if (isNaN(v) || v + '' != vs)
throw 42;
if (isNaN(band))
r.amp = Math.round((v + step * 0.2) * 100) / 100;
else
r.gains[band] = v + step;
r.apply();
}
catch (ex) {
return;
err = true;
}
r.apply();
clmod(that, 'err', err);
}
function eq_mod(e) {