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
+3
View File
@@ -101,6 +101,8 @@ export interface DeviceState {
dreMode: number;
dacVolumeDirect: number;
analogGain: number;
/** USB Audio Class version: 0 = UAC 2.0, 1 = UAC 1.0. */
uac_ver: number;
effect_enable: number;
effect_value: number;
width_enable: number;
@@ -488,6 +490,7 @@ export const MOCK_DEVICE_STATE: DeviceState = {
dreMode: 0,
dacVolumeDirect: 0,
analogGain: 0,
uac_ver: 0,
effect_enable: 0,
effect_value: 50,
width_enable: 0,
+15 -1
View File
@@ -168,7 +168,8 @@
"options": [
"BS2B Standard (700 Hz, 4,5 dB)",
"BS2B Populär (700 Hz, 6 dB)",
"BS2B Entspannt (650 Hz, 9,5 dB)"
"BS2B Entspannt (650 Hz, 9,5 dB)",
"Custom"
]
},
"subwoofer": {
@@ -588,6 +589,19 @@
}
]
},
"uacVer": {
"label": "UAC-Version",
"options": [
{
"index": 0,
"label": "UAC 2.0"
},
{
"index": 1,
"label": "UAC 1.0"
}
]
},
"arc": {
"label": "ARC-Modus",
"options": [
+15 -1
View File
@@ -168,7 +168,8 @@
"options": [
"BS2B default (700 Hz, 4.5 dB)",
"BS2B popular (700 Hz, 6 dB)",
"BS2B relax (650 Hz, 9.5 dB)"
"BS2B relax (650 Hz, 9.5 dB)",
"Custom"
]
},
"subwoofer": {
@@ -588,6 +589,19 @@
}
]
},
"uacVer": {
"label": "UAC Version",
"options": [
{
"index": 0,
"label": "UAC 2.0"
},
{
"index": 1,
"label": "UAC 1.0"
}
]
},
"arc": {
"label": "ARC mode",
"options": [
+15 -1
View File
@@ -168,7 +168,8 @@
"options": [
"BS2B predeterminado (700 Hz, 4,5 dB)",
"BS2B popular (700 Hz, 6 dB)",
"BS2B relajado (650 Hz, 9,5 dB)"
"BS2B relajado (650 Hz, 9,5 dB)",
"Custom"
]
},
"subwoofer": {
@@ -588,6 +589,19 @@
}
]
},
"uacVer": {
"label": "Versión UAC",
"options": [
{
"index": 0,
"label": "UAC 2.0"
},
{
"index": 1,
"label": "UAC 1.0"
}
]
},
"arc": {
"label": "Modo ARC",
"options": [
+15 -1
View File
@@ -168,7 +168,8 @@
"options": [
"BS2B défaut (700 Hz, 4,5 dB)",
"BS2B populaire (700 Hz, 6 dB)",
"BS2B relax (650 Hz, 9,5 dB)"
"BS2B relax (650 Hz, 9,5 dB)",
"Custom"
]
},
"subwoofer": {
@@ -588,6 +589,19 @@
}
]
},
"uacVer": {
"label": "Version UAC",
"options": [
{
"index": 0,
"label": "UAC 2.0"
},
{
"index": 1,
"label": "UAC 1.0"
}
]
},
"arc": {
"label": "Mode ARC",
"options": [
+15 -1
View File
@@ -168,7 +168,8 @@
"options": [
"BS2B default(700Hz,4.5dB)",
"BS2B polular(700Hz,6dB)",
"BS2B relax(650Hz,9.5dB)"
"BS2B relax(650Hz,9.5dB)",
"Custom"
]
},
"subwoofer": {
@@ -588,6 +589,19 @@
}
]
},
"uacVer": {
"label": "UAC版本",
"options": [
{
"index": 0,
"label": "UAC 2.0"
},
{
"index": 1,
"label": "UAC 1.0"
}
]
},
"arc": {
"label": "ARC模式",
"options": [
+15 -1
View File
@@ -168,7 +168,8 @@
"options": [
"BS2B default(700Hz,4.5dB)",
"BS2B polular(700Hz,6dB)",
"BS2B relax(650Hz,9.5dB)"
"BS2B relax(650Hz,9.5dB)",
"Custom"
]
},
"subwoofer": {
@@ -588,6 +589,19 @@
}
]
},
"uacVer": {
"label": "UAC版本",
"options": [
{
"index": 0,
"label": "UAC 2.0"
},
{
"index": 1,
"label": "UAC 1.0"
}
]
},
"arc": {
"label": "ARC模式",
"options": [
+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>
+1
View File
@@ -52,6 +52,7 @@ const KEY_TO_SETTING: Record<string, string> = {
dacGain: "dacGain",
dacImpedance: "dacImpedance",
dacVolumeDirect: "dacVolumeDirect",
uacVer: "uac_ver",
vu: "vu",
input: "input",
output: "output",