refactor(eq): 更新EQ页面以优化预设缓存和滤波器管理

- 添加实时滑块预览状态以改善用户体验
- 重构预设缓存逻辑,使用新的PeqPresetLocalCache类型管理滤波器和增益设置
- 更新相关函数以支持新的预设缓存机制,减少重复计算
- 增强滤波器持久化逻辑,确保在耳机切换时正确保存和应用滤波器设置
This commit is contained in:
yangy
2026-05-29 19:01:56 +08:00
parent 3f9b2f0e7b
commit 5f8d9a99a4
3 changed files with 147 additions and 48 deletions
+7
View File
@@ -52,6 +52,13 @@ export const DEFAULT_BANDS = [
/* ── PEQ catalog item type ── */
export type PeqCatalogItem = NonNullable<PeqState["peq"]>[number];
/** 本地编辑缓存(按预设名称);syncPeq 拉取时优先于设备 catalog */
export type PeqPresetLocalCache = {
filters?: PeqFilter[];
preamp?: number;
autoPre?: number;
};
/* ── Flat preset filters ── */
export const FLAT_PRESET_FILTERS: PeqFilter[] = [
{ type: 4, fc: 80, gain: 0, q: 0.1 },