feat(api): 新增 UAC 版本支持及相关界面改进

- 在音频参数中加入 uac_ver 字段,支持区分 UAC 2.0 和 UAC 1.0
- 在多语言资源中添加 UAC 版本选项及对应标签(中英文、德语、西班牙语、法语、繁体中文等)
- 在 AudioPage 页面新增 UAC 版本选择组件,支持用户选择不同版本
- 在 SelectPage 中加入 uac_ver 的映射,保证数据正确传递
- 为 UAC 版本选项新增“Custom”自定义项,丰富配置可能性
This commit is contained in:
eafonyang
2026-09-08 14:19:26 +08:00
parent f6f8bee11a
commit 33a5b8a9b0
9 changed files with 102 additions and 6 deletions
+8
View File
@@ -119,6 +119,7 @@ type LocaleDac = {
autoImpedance?: { label?: string; options?: Array<{ index: number; label: string }> };
dreMode?: { label?: string; options?: Array<{ index: number; label: string }> };
dacVolumeDirect?: { label?: string; options?: Array<{ index: number; label: string }> };
uacVer?: { label?: string; options?: Array<{ index: number; label: string }> };
volumeStep?: string;
bootVolume?: string | { label?: string; options?: Array<{ index: number; label: string }> };
xlr?: { label?: string; options?: Array<{ index: number; label: string }> };
@@ -222,6 +223,7 @@ export default function AudioPage() {
const xlrIdx = ds?.xlr ?? 0;
const mutePolarIdx = (ds as ({ hdmimutepolar?: number } | null))?.hdmimutepolar ?? 0;
const iisModeIdx = (ds as ({ hdmiType?: number } | null))?.hdmiType ?? 0;
const uacVerIdx = Math.min(Math.max(ds?.uac_ver ?? 0, 0), 1);
const bootSoundVal = normalizeBootSound(localBootSound);
const firmwareVersion = parseFirmwareVersion(ds?.version);
const bootSoundMaxIdx = getBootSoundMaxIndex(firmwareVersion);
@@ -238,6 +240,7 @@ export default function AudioPage() {
"0dB",
"-12dB",
]);
const UAC_VER_OPTIONS = optionLabels(dacText.uacVer?.options, ["UAC 2.0", "UAC 1.0"]);
const pageTitle = usePageTitleWithConnection(localeData.home?.audioSet ?? "Audio");
@@ -388,6 +391,11 @@ export default function AudioPage() {
value={XLR_OPTIONS[xlrIdx] ?? XLR_OPTIONS[0] ?? "—"}
onClick={() => goSelect(dacText.xlr?.label ?? "选择 XLR 极性", XLR_OPTIONS, xlrIdx, "xlr")}
/>
<ListRow
label={dacText.uacVer?.label ?? "UAC 版本"}
value={UAC_VER_OPTIONS[uacVerIdx] ?? UAC_VER_OPTIONS[0] ?? "—"}
onClick={() => goSelect(dacText.uacVer?.label ?? "选择 UAC 版本", UAC_VER_OPTIONS, uacVerIdx, "uacVer")}
/>
</div>
</div>