style: auto-fix linting issues

This commit is contained in:
tryptz 2026-04-07 04:36:04 +00:00 committed by edideaur
parent a16d489b9f
commit 4192263176
4 changed files with 53 additions and 34 deletions

View file

@ -4174,33 +4174,29 @@
× ×
</button> </button>
<div <div class="eq-howto-tab legacy" id="eq-howto-legacy" style="display: none">
class="eq-howto-tab legacy"
id="eq-howto-legacy"
style="display: none"
>
<h4>Legacy EQ - Graphic Equalizer</h4> <h4>Legacy EQ - Graphic Equalizer</h4>
<ol> <ol>
<li> <li>
Set the <b>number of bands</b> (3-32) and Set the <b>number of bands</b> (3-32) and
<b>frequency range</b> (Min/Max Hz) at the top to <b>frequency range</b> (Min/Max Hz) at the top to customize the
customize the equalizer layout. equalizer layout.
</li> </li>
<li> <li>
<b>Drag the sliders</b> to boost or cut each frequency <b>Drag the sliders</b> to boost or cut each frequency band. Bands
band. Bands are spaced logarithmically across your range. are spaced logarithmically across your range.
</li> </li>
<li> <li>
Pick a <b>preset</b> (Bass Boost, Rock, Vocal, etc.) as a Pick a <b>preset</b> (Bass Boost, Rock, Vocal, etc.) as a starting
starting point - presets auto-scale to your band count. point - presets auto-scale to your band count.
</li> </li>
<li> <li>
Adjust the <b>preamp</b> slider to raise or lower the overall Adjust the <b>preamp</b> slider to raise or lower the overall level
level - reduce it if you hear distortion from large boosts. - reduce it if you hear distortion from large boosts.
</li> </li>
<li> <li>
<b>Save</b> your own custom presets with a name so you can <b>Save</b> your own custom presets with a name so you can recall
recall them later. them later.
</li> </li>
<li> <li>
<b>Export</b> saves the EQ in EqualizerAPO text format. <b>Export</b> saves the EQ in EqualizerAPO text format.
@ -4208,17 +4204,15 @@
directly into Equalizer APO's config.txt. directly into Equalizer APO's config.txt.
</li> </li>
<li> <li>
<b>Import</b> loads EQ settings from EqualizerAPO text files <b>Import</b> loads EQ settings from EqualizerAPO text files or
or simple frequency/gain CSV files - points are mapped to simple frequency/gain CSV files - points are mapped to your current
your current bands automatically. bands automatically.
</li>
<li>
Click <b>Reset</b> to flatten all bands back to 0 dB.
</li> </li>
<li>Click <b>Reset</b> to flatten all bands back to 0 dB.</li>
</ol> </ol>
<p class="eq-howto-tip"> <p class="eq-howto-tip">
Tip: Cut problem frequencies rather than boosting others - it Tip: Cut problem frequencies rather than boosting others - it sounds
sounds cleaner and avoids clipping. cleaner and avoids clipping.
</p> </p>
</div> </div>

View file

@ -731,7 +731,11 @@ class AudioContextManager {
const coeffs = computeShelfCoefficients(type, freq, gain, q, this.audioContext.sampleRate); const coeffs = computeShelfCoefficients(type, freq, gain, q, this.audioContext.sampleRate);
const iir = this.audioContext.createIIRFilter(coeffs.feedforward, coeffs.feedback); const iir = this.audioContext.createIIRFilter(coeffs.feedforward, coeffs.feedback);
iir._shelfType = type; iir._shelfType = type;
try { filter.disconnect(); } catch { /* ignore */ } try {
filter.disconnect();
} catch {
/* ignore */
}
this.filters[index] = iir; this.filters[index] = iir;
} }
@ -939,10 +943,20 @@ class AudioContextManager {
if (isShelf) { if (isShelf) {
// IIR filters can't update params — must replace the node // IIR filters can't update params — must replace the node
const coeffs = computeShelfCoefficients(type, newFrequencies[i], newGains[i], q, this.audioContext.sampleRate); const coeffs = computeShelfCoefficients(
type,
newFrequencies[i],
newGains[i],
q,
this.audioContext.sampleRate
);
const iir = this.audioContext.createIIRFilter(coeffs.feedforward, coeffs.feedback); const iir = this.audioContext.createIIRFilter(coeffs.feedforward, coeffs.feedback);
iir._shelfType = type; iir._shelfType = type;
try { filter.disconnect(); } catch { /* ignore */ } try {
filter.disconnect();
} catch {
/* ignore */
}
this.filters[i] = iir; this.filters[i] = iir;
needsReconnect = true; needsReconnect = true;
} else if (wasShelf) { } else if (wasShelf) {
@ -952,7 +966,11 @@ class AudioContextManager {
biquad.frequency.value = newFrequencies[i]; biquad.frequency.value = newFrequencies[i];
biquad.gain.value = newGains[i]; biquad.gain.value = newGains[i];
biquad.Q.value = q; biquad.Q.value = q;
try { filter.disconnect(); } catch { /* ignore */ } try {
filter.disconnect();
} catch {
/* ignore */
}
this.filters[i] = biquad; this.filters[i] = biquad;
needsReconnect = true; needsReconnect = true;
} else { } else {

View file

@ -1667,9 +1667,8 @@ export async function initializeSettings(scrobbler, player, api, ui) {
updateDeleteBtnVisibility(); updateDeleteBtnVisibility();
return; return;
} }
const adjusted = gains.length !== geqBandCount const adjusted =
? equalizerSettings._interpolateGains(gains, geqBandCount) gains.length !== geqBandCount ? equalizerSettings._interpolateGains(gains, geqBandCount) : gains;
: gains;
geqGains = adjusted.map((g) => { geqGains = adjusted.map((g) => {
const n = Number(g); const n = Number(g);
return Number.isFinite(n) return Number.isFinite(n)

View file

@ -1730,7 +1730,9 @@ export const equalizerSettings = {
const num = parseInt(val, 10); const num = parseInt(val, 10);
if (num >= 3 && num <= 32) return num; if (num >= 3 && num <= 32) return num;
} }
} catch { /* ignore */ } } catch {
/* ignore */
}
return 16; return 16;
}, },
@ -1738,7 +1740,9 @@ export const equalizerSettings = {
const clamped = Math.max(3, Math.min(32, parseInt(count, 10) || 16)); const clamped = Math.max(3, Math.min(32, parseInt(count, 10) || 16));
try { try {
localStorage.setItem(this.GEQ_BAND_COUNT_KEY, String(clamped)); localStorage.setItem(this.GEQ_BAND_COUNT_KEY, String(clamped));
} catch { /* ignore */ } } catch {
/* ignore */
}
}, },
getGraphicEqFreqRange() { getGraphicEqFreqRange() {
@ -1750,7 +1754,9 @@ export const equalizerSettings = {
return parsed; return parsed;
} }
} }
} catch { /* ignore */ } } catch {
/* ignore */
}
return { min: 25, max: 20000 }; return { min: 25, max: 20000 };
}, },
@ -1760,7 +1766,9 @@ export const equalizerSettings = {
if (clampedMin >= clampedMax) return; if (clampedMin >= clampedMax) return;
try { try {
localStorage.setItem(this.GEQ_FREQ_RANGE_KEY, JSON.stringify({ min: clampedMin, max: clampedMax })); localStorage.setItem(this.GEQ_FREQ_RANGE_KEY, JSON.stringify({ min: clampedMin, max: clampedMax }));
} catch { /* ignore */ } } catch {
/* ignore */
}
}, },
getGraphicEqGains(bandCount) { getGraphicEqGains(bandCount) {