新增音量保护

This commit is contained in:
eafonyang
2026-09-22 11:55:48 +08:00
parent 8c4c14c40e
commit 6937705fa1
2 changed files with 30 additions and 0 deletions
+6
View File
@@ -2,6 +2,12 @@
> This document records feature updates and bug fixes for the Luxsin X8 controller. Entries are listed in reverse chronological order — the newest release appears first.
## v2026.09.22
### New Features
- Added a dedicated "Headphone settings" section on the Audio page, grouping headphone gain and automatic headphone impedance detection.
- Added maximum headphone volume and headphone startup volume settings. These two settings are shown only on firmware version 1.0.31.0 (build 31) or later.
## v2026.09.09
### New Features
+24
View File
@@ -192,12 +192,35 @@ export default function Home() {
const [volumeConfirm, setVolumeConfirm] = useState<null | "min" | "max">(null);
const [easterEggActive, setEasterEggActive] = useState(false);
const [vuHeights, setVuHeights] = useState<number[]>(idleVuBarHeights);
/** 更新说明入口展示的最新版本号(取自 changelog.md 首个 "## v..." 标题) */
const [changelogVersion, setChangelogVersion] = useState<string | null>(null);
const jackProgressRef = useRef(0);
const jackResetTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const eggRafRef = useRef<number | null>(null);
/** 下次三连击成功时播放的律动:1=旋律,2=海浪(各需单独三连击触发) */
const jackEggNextRef = useRef<1 | 2>(1);
// 拉取更新说明首个版本号,静默降级(失败则入口不显示版本)
useEffect(() => {
let cancelled = false;
fetch(`${import.meta.env.BASE_URL}changelog.md`)
.then((res) => {
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.text();
})
.then((text) => {
if (cancelled) return;
const m = text.match(/^##\s+(v[^\s#]+)\s*$/m);
if (m) setChangelogVersion(m[1]);
})
.catch(() => {
/* 静默:入口不显示版本号 */
});
return () => {
cancelled = true;
};
}, []);
const homeText = useMemo((): HomeLocale => {
if (!deviceState) return {} as HomeLocale;
const loc =
@@ -878,6 +901,7 @@ export default function Home() {
<ListRow
icon={<BookOpenCheck size={18} />}
label={homeText.changelog ?? "更新说明"}
value={changelogVersion ?? undefined}
onClick={() => setLocation("/changelog")}
/>
</div>