修复bug
This commit is contained in:
@@ -171,6 +171,9 @@ export interface PeqApplyPayload {
|
||||
export const INPUT_LABELS = ["USB", "USB-C", "Coaxial", "Optical", "Bluetooth", "IIS", "RCA"];
|
||||
export const OUTPUT_LABELS = ["XLR", "RCA", "Headset", "XLR/RCA"];
|
||||
|
||||
/** Device `input` index for Bluetooth source. */
|
||||
export const INPUT_BLUETOOTH_INDEX = 4;
|
||||
|
||||
/** Device `output` index for headphone / headset. */
|
||||
export const OUTPUT_HEADSET_INDEX = 2;
|
||||
export const LANGUAGE_LABELS = ["English", "繁體中文", "简体中文"];
|
||||
@@ -345,6 +348,19 @@ export function parseFirmwareVersion(version: unknown): number {
|
||||
return Number(parts[parts.length - 1]);
|
||||
}
|
||||
|
||||
/** Display firmware version as X.Y.0.Z (e.g. 2005 → 2.0.0.5). */
|
||||
export function formatFirmwareVersionDisplay(version: unknown): string {
|
||||
if (version === null || version === undefined || String(version).trim() === "") {
|
||||
return "—";
|
||||
}
|
||||
const n = parseFirmwareVersion(version);
|
||||
const major = Math.floor(n / 1000);
|
||||
const minor = Math.floor((n % 1000) / 100);
|
||||
const patch = 0;
|
||||
const build = n % 10;
|
||||
return `${major}.${minor}.${patch}.${build}`;
|
||||
}
|
||||
|
||||
/** Pre-out volume passthrough mode selected (0dB or -12dB). */
|
||||
export function isVolumePassthroughActive(dacVolumeDirect: number | undefined): boolean {
|
||||
return dacVolumeDirect === 1 || dacVolumeDirect === 2;
|
||||
|
||||
Reference in New Issue
Block a user