/* ============================================================ DSP & DAC PAGE Design: iOS Settings style Sections: DSP引擎 / DAC配置 / 模拟级 / 音频格式 All selectable options → navigate to /select page ============================================================ */ import { useDevice } from "@/contexts/DeviceContext"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { useLocation } from "wouter"; import BottomNav from "@/components/BottomNav"; import { navigateToSelect } from "./SelectPage"; function IOSToggle({ checked, onChange }: { checked: boolean; onChange: (v: boolean) => void }) { return ( ); } function SectionHeader({ title }: { title: string }) { return (
{title}
); } function ListRow({ label, description, value, onClick, toggle, checked, onToggle }: { label: string; description?: string; value?: string; onClick?: () => void; toggle?: boolean; checked?: boolean; onToggle?: (v: boolean) => void; }) { if (toggle) { return (
{label}
{description &&
{description}
}
{})} />
); } return ( ); } const DAC_ARC_OPTIONS = ["关闭", "模式1", "模式2", "模式3"]; const DAC_GAIN_OPTIONS = ["0dB", "+3dB", "+6dB", "+9dB"]; const DAC_IMP_OPTIONS = ["32Ω", "150Ω", "300Ω"]; const ANALOG_GAIN_OPTIONS = ["低", "中低", "中高", "高"]; const XLR_OPTIONS = ["正常", "反转"]; export default function DspPage() { const [, setLocation] = useLocation(); const { deviceState, updateSetting } = useDevice(); const ds = deviceState; const dspOn = (ds?.dsp_enable ?? 0) === 0; const peqOn = (ds?.peqEnable ?? 0) === 1; const dacVolDirect = (ds?.dacVolumeDirect ?? 0) === 1; const dacArcIdx = ds?.dacArc ?? 0; const dacGainIdx = ds?.dacGain ?? 0; const dacImpIdx = ds?.dacImpedance ?? 0; const analogGainIdx = ds?.analogGain ?? 0; const xlrIdx = ds?.xlr ?? 0; const goSelect = (title: string, options: string[], selected: number, key: string) => { navigateToSelect(title, options, selected, "/dsp", key); setLocation("/select"); }; return (

DSP & DAC

{/* ── DSP 引擎 ── */}
updateSetting({ dsp_enable: v ? 0 : 1 })} /> updateSetting({ peqEnable: v ? 1 : 0 })} />
{/* ── DAC 配置 ── */}
goSelect("ARC 模式", DAC_ARC_OPTIONS, dacArcIdx, "dacArc")} /> goSelect("DAC 增益", DAC_GAIN_OPTIONS, dacGainIdx, "dacGain")} /> goSelect("DAC 阻抗", DAC_IMP_OPTIONS, dacImpIdx, "dacImpedance")} /> updateSetting({ dacVolumeDirect: v ? 1 : 0 })} />
{/* ── 模拟级 ── */}
goSelect("模拟增益", ANALOG_GAIN_OPTIONS, analogGainIdx, "analogGain")} /> goSelect("XLR 极性", XLR_OPTIONS, xlrIdx, "xlr")} />
{/* ── 音频格式 ── */}
{ds?.audioFormat ?? "PCM 44.1kHz"}
); }