diff --git a/client/src/config/firmwareFeatures.ts b/client/src/config/firmwareFeatures.ts index 91f9925..feda34f 100644 --- a/client/src/config/firmwareFeatures.ts +++ b/client/src/config/firmwareFeatures.ts @@ -5,8 +5,8 @@ * Adjust thresholds here instead of hardcoding in page components. */ export const FIRMWARE_FEATURE_MIN_VERSION = { - /** Boot sound: indices 7–10 (-35…-50 dB); legacy firmware caps at index 6. */ - bootSoundExtendedSteps: 26, + /** BD9 默认提供开机音量索引 7–10(-35…-50 dB),不按固件版本隐藏。 */ + bootSoundExtendedSteps: 0, /** Subwoofer LPF/HPF full-range toggles on the Effects page. */ subwooferFullRange: 2001, /** PEQ preset rename (peqRename) and reorder (peqSoft) in manage dialog. */ diff --git a/client/src/lib/luxsinApi.ts b/client/src/lib/luxsinApi.ts index 0d62bd8..947394d 100644 --- a/client/src/lib/luxsinApi.ts +++ b/client/src/lib/luxsinApi.ts @@ -132,6 +132,10 @@ export interface DeviceState { bt_title: string; bt_artist: string; msgCount: number; + led_enable: number; + led_red: number; + led_green: number; + led_blue: number; } export interface HearingProfile { @@ -517,6 +521,14 @@ export function formatFirmwareVersionDisplay(version: unknown): string { return `${major}.${minor}.${patch}.${build}`; } +/** BD9 的 soundStep 档位按索引对应的 dB 幅度。 */ +export const VOLUME_STEP_DB = [0.5, 1, 1.5, 2] as const; + +/** 将音量幅度档位换算为 volume 单位(1 单位 = 0.5dB)。 */ +export function getVolumeStep(soundStep: number | undefined): number { + return (VOLUME_STEP_DB[soundStep ?? 1] ?? VOLUME_STEP_DB[0]) * 2; +} + /** Pre-out volume passthrough mode selected (0dB or -12dB). */ export function isVolumePassthroughActive(dacVolumeDirect: number | undefined): boolean { return dacVolumeDirect === 1 || dacVolumeDirect === 2; @@ -533,6 +545,13 @@ export function isHomeVolumeLockedByPassthrough( export { getBootSoundMaxIndex } from "@/config/firmwareFeatures"; +/** 将氛围灯 RGB 通道值归一化为 0–255 的整数。 */ +export function clampLedChannel(value: unknown): number { + const n = typeof value === "number" ? value : Number(value); + if (!Number.isFinite(n)) return 0; + return Math.max(0, Math.min(255, Math.round(n))); +} + /** Normalize `bootSound` from syncData (0 = default … 10 = -50 dB). */ export function normalizeBootSound(value: unknown): number { const n = typeof value === "number" ? value : Number(value); @@ -623,6 +642,10 @@ export const MOCK_DEVICE_STATE: DeviceState = { bt_title: "Bohemian Rhapsody", bt_artist: "Queen", msgCount: 42, + led_enable: 1, + led_red: 128, + led_green: 64, + led_blue: 200, }; export const MOCK_PEQ_STATE: PeqState = { diff --git a/client/src/locales/data-de.json b/client/src/locales/data-de.json index c0a479a..e8319f3 100644 --- a/client/src/locales/data-de.json +++ b/client/src/locales/data-de.json @@ -56,8 +56,8 @@ "pageTitle": "I/O", "inputSection": "Eingang", "outputSection": "Ausgang", - "inputOptions": ["USB-B", "USB-C", "Koaxial", "Optisch", "Bluetooth", "IIS", "RCA", "Lokaler Eingang"], - "outputOptions": ["XLR", "RCA", "XLR/RCA", "Kopfhörer"], + "inputOptions": ["USB-B", "USB-C", "Koaxial", "Optisch", "Bluetooth", "IIS", "AES", "USB-Stick"], + "outputOptions": ["XLR", "RCA", "XLR/RCA"], "input": { "coaxial": "KOAXIAL", "optical": "OPTISCH", @@ -580,7 +580,12 @@ "deviceName": "Gerätename", "firmwareVersion": "Firmware-Version", "macAddress": "MAC-Adresse", - "deviceIp": "Geräte-IP" + "deviceIp": "Geräte-IP", + "sectionAmbientLight": "Ambientebeleuchtung", + "ambientLight": "Hauptschalter", + "ledRed": "Rot", + "ledGreen": "Grün", + "ledBlue": "Blau" } }, "prompt": { diff --git a/client/src/locales/data-en.json b/client/src/locales/data-en.json index edba42f..f26e112 100644 --- a/client/src/locales/data-en.json +++ b/client/src/locales/data-en.json @@ -56,8 +56,8 @@ "pageTitle": "I/O", "inputSection": "Input", "outputSection": "Output", - "inputOptions": ["USB-B", "USB-C", "Coaxial", "Optical", "Bluetooth", "IIS", "RCA", "Local Input"], - "outputOptions": ["XLR", "RCA", "XLR/RCA", "Headset"], + "inputOptions": ["USB-B", "USB-C", "Coaxial", "Optical", "Bluetooth", "IIS", "AES", "USB Drive"], + "outputOptions": ["XLR", "RCA", "XLR/RCA"], "input": { "coaxial": "COAXIAL", "optical": "OPTICAL", @@ -580,7 +580,12 @@ "deviceName": "Device name", "firmwareVersion": "Firmware version", "macAddress": "MAC address", - "deviceIp": "Device IP" + "deviceIp": "Device IP", + "sectionAmbientLight": "Ambient light", + "ambientLight": "Master switch", + "ledRed": "Red", + "ledGreen": "Green", + "ledBlue": "Blue" } }, "prompt": { diff --git a/client/src/locales/data-es.json b/client/src/locales/data-es.json index 7fd1a53..9637db7 100644 --- a/client/src/locales/data-es.json +++ b/client/src/locales/data-es.json @@ -56,8 +56,8 @@ "pageTitle": "E/S", "inputSection": "Entrada", "outputSection": "Salida", - "inputOptions": ["USB-B", "USB-C", "Coaxial", "Óptico", "Bluetooth", "IIS", "RCA", "Entrada local"], - "outputOptions": ["XLR", "RCA", "XLR/RCA", "Auriculares"], + "inputOptions": ["USB-B", "USB-C", "Coaxial", "Óptico", "Bluetooth", "IIS", "AES", "Memoria USB"], + "outputOptions": ["XLR", "RCA", "XLR/RCA"], "input": { "coaxial": "COAXIAL", "optical": "ÓPTICO", @@ -580,7 +580,12 @@ "deviceName": "Nombre del dispositivo", "firmwareVersion": "Versión de firmware", "macAddress": "Dirección MAC", - "deviceIp": "IP del dispositivo" + "deviceIp": "IP del dispositivo", + "sectionAmbientLight": "Iluminación ambiental", + "ambientLight": "Interruptor principal", + "ledRed": "Rojo", + "ledGreen": "Verde", + "ledBlue": "Azul" } }, "prompt": { diff --git a/client/src/locales/data-fr.json b/client/src/locales/data-fr.json index 5665630..1cd709a 100644 --- a/client/src/locales/data-fr.json +++ b/client/src/locales/data-fr.json @@ -56,8 +56,8 @@ "pageTitle": "E/S", "inputSection": "Entrée", "outputSection": "Sortie", - "inputOptions": ["USB-B", "USB-C", "Coaxial", "Optique", "Bluetooth", "IIS", "RCA", "Entrée locale"], - "outputOptions": ["XLR", "RCA", "XLR/RCA", "Casque"], + "inputOptions": ["USB-B", "USB-C", "Coaxial", "Optique", "Bluetooth", "IIS", "AES", "Clé USB"], + "outputOptions": ["XLR", "RCA", "XLR/RCA"], "input": { "coaxial": "COAXIAL", "optical": "OPTIQUE", @@ -580,7 +580,12 @@ "deviceName": "Nom de l'appareil", "firmwareVersion": "Version du firmware", "macAddress": "Adresse MAC", - "deviceIp": "IP de l'appareil" + "deviceIp": "IP de l'appareil", + "sectionAmbientLight": "Éclairage d'ambiance", + "ambientLight": "Interrupteur principal", + "ledRed": "Rouge", + "ledGreen": "Vert", + "ledBlue": "Bleu" } }, "prompt": { diff --git a/client/src/locales/data-zh-HK.json b/client/src/locales/data-zh-HK.json index cb0a393..c628aaf 100644 --- a/client/src/locales/data-zh-HK.json +++ b/client/src/locales/data-zh-HK.json @@ -56,8 +56,8 @@ "pageTitle": "輸入/輸出", "inputSection": "輸入", "outputSection": "輸出", - "inputOptions": ["USB-B", "USB-C", "同軸", "光纖", "藍牙", "IIS", "類比RCA", "本地輸入"], - "outputOptions": ["XLR", "RCA", "XLR/RCA", "耳機"], + "inputOptions": ["USB-B", "USB-C", "同軸", "光纖", "藍牙", "IIS", "AES", "U 盤"], + "outputOptions": ["XLR", "RCA", "XLR/RCA"], "input": { "coaxial": "同軸", "optical": "光纖", "bluetooth": "藍牙", "rca": "類比RCA" }, "output": { "headset": "耳機" } }, @@ -574,7 +574,12 @@ "deviceName": "裝置名稱", "firmwareVersion": "韌體版本", "macAddress": "MAC 位址", - "deviceIp": "裝置 IP" + "deviceIp": "裝置 IP", + "sectionAmbientLight": "氛圍燈", + "ambientLight": "總開關", + "ledRed": "紅", + "ledGreen": "綠", + "ledBlue": "藍" } }, "prompt": { diff --git a/client/src/locales/data-zh.json b/client/src/locales/data-zh.json index a63a1d4..bc97aa3 100644 --- a/client/src/locales/data-zh.json +++ b/client/src/locales/data-zh.json @@ -56,8 +56,8 @@ "pageTitle": "输入输出", "inputSection": "输入", "outputSection": "输出", - "inputOptions": ["USB-B", "USB-C", "同轴", "光纤", "蓝牙", "IIS", "模拟RCA", "本地输入"], - "outputOptions": ["XLR", "RCA", "XLR/RCA", "耳机"], + "inputOptions": ["USB-B", "USB-C", "同轴", "光纤", "蓝牙", "IIS", "AES", "U 盘"], + "outputOptions": ["XLR", "RCA", "XLR/RCA"], "input": { "coaxial": "同轴", "optical": "光纤", "bluetooth": "蓝牙", "rca": "模拟RCA" }, "output": { "headset": "耳机" } }, @@ -575,7 +575,12 @@ "deviceName": "设备名称", "firmwareVersion": "固件版本", "macAddress": "MAC 地址", - "deviceIp": "设备 IP" + "deviceIp": "设备 IP", + "sectionAmbientLight": "氛围灯", + "ambientLight": "总开关", + "ledRed": "红", + "ledGreen": "绿", + "ledBlue": "蓝" } }, "prompt": { diff --git a/client/src/pages/AudioPage.tsx b/client/src/pages/AudioPage.tsx index a67bfbc..76fea27 100644 --- a/client/src/pages/AudioPage.tsx +++ b/client/src/pages/AudioPage.tsx @@ -3,7 +3,7 @@ Design: Reference luxsin_x8_音频设置.png Sections: - 平衡与灵敏度: 左右平衡, VU灵敏度, 模拟输入增益 sliders - - 输出特性: 滤波特性, 耳机增益, 音量幅度 + - 输出特性: 前级输出音量直通模式, 音量幅度 - IIS设置: IIS静音电平, IIS模式 - 系统与接口: 开机音量, XLR极性 All list rows → navigate to /select page @@ -19,6 +19,7 @@ import { normalizeBootSound, parseFirmwareVersion, readBootSoundFromState, + VOLUME_STEP_DB, } from "@/lib/luxsinApi"; import localeEn from "@/locales/data-en.json"; import { resolveLocalePack } from "@/locales/resolveLocale"; @@ -73,31 +74,11 @@ function SectionHeader({ title }: { title: string }) { ); } -function IOSToggle({ checked, onChange }: { checked: boolean; onChange: (v: boolean) => void }) { - return ( - - ); -} - -function ListRow({ label, value, onClick, toggle, checked, onToggle }: { +function ListRow({ label, value, onClick }: { label: string; value?: string; onClick?: () => void; - toggle?: boolean; - checked?: boolean; - onToggle?: (v: boolean) => void; }) { - if (toggle) { - return ( -
- {label} - {})} /> -
- ); - } return (