拆分 EQPage 页面,新增分享码功能,修复 bug,优化性能

This commit is contained in:
eafonyang
2026-06-15 18:39:07 +08:00
parent 1b0b447eee
commit a045db235a
15 changed files with 3198 additions and 1181 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
import { getFilterType } from "@/lib/peqAudio";
import type { PeqFilter, PeqState } from "@/lib/luxsinApi";
import { normalizePeqFiltersForSubmit, type PeqFilter, type PeqState } from "@/lib/luxsinApi";
import type { EqBand } from "./types";
export function cloneBands(source: EqBand[]) {
@@ -54,3 +54,15 @@ export function bandToPeqFilter(b: {
type: getFilterType(b.type),
};
}
export function importedFiltersToPeqFilters(filters: unknown): PeqFilter[] {
return normalizePeqFiltersForSubmit(filters).map((f) => {
const item = f as unknown as Record<string, unknown>;
return {
fc: Number(item.fc ?? item.freq ?? item.frequency ?? 1000),
gain: Number(item.gain ?? 0),
q: Number(item.q ?? 1),
type: getFilterType(item.type as string | number),
};
});
}