为 LX Music Desktop 添加 Halo PixelBar USB HID 歌词同步功能,支持实时歌词、歌曲信息显示及布局切换。#2876
Open
nxz1026 wants to merge 4 commits into
Open
为 LX Music Desktop 添加 Halo PixelBar USB HID 歌词同步功能,支持实时歌词、歌曲信息显示及布局切换。#2876nxz1026 wants to merge 4 commits into
nxz1026 wants to merge 4 commits into
Conversation
- Add node-hid dependency for USB HID communication - Create HID packet builder (64-byte protocol for Halo PixelBar) - Create HID device communicator (device discovery, connect, send) - Create halo module entry with lyric sync logic: * Directly reads global.lx.player_status for zero-latency lyrics * LRC binary search fallback when lyricLineText is empty * Song info display on track change (3s duration) * Auto switch to clock UI after 30s idle timeout * Configurable color, layout, max chars, progress display - Add halo settings UI (Pug/Less, following existing patterns) - Add i18n strings for both zh-cn and en-us - Register halo module in modules/index.ts
feat: add Halo PixelBar USB HID lyric sync module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能
实时歌词同步(50ms 轮询,LRC 二分查找)
歌曲信息动画(歌名 - 歌手交替显示)
30 秒无播放后自动切换时钟模式
三种布局模式(静态居中 / 静态居中大号 / 滚动)
可配置最大字符数和进度条显示
模拟模式(未连接设备时本地打印日志)
技术细节
纯 TypeScript 实现,无外部依赖(仅 node-hid 用于 USB HID 通信)
直接读取 global.lx.player_state 实现零延迟
64 字节 HID 报文协议,支持文本/布局/UI 模式三种报文
byte 4 固定为 0x00(C# 官方参考实现一致,非零值导致固件崩溃)
CJK UTF-8 截断保护(MAX_TEXT_BYTES = 53)+ displayWidth emoji 宽度识别
操作说明
设置 → Halo 音箱 → 开启同步
连接 Halo PixelBar USB 设备后自动识别
支持调整最大字符数、进度条、布局模式