feat: support word-by-word lyric parsing and highlighting - #736
Open
kt286 wants to merge 1 commit into
Open
Conversation
Reviewer's GuideAdds end-to-end support for word-by-word LRC lyrics: parsing multi-timestamp lines into per-word timing structures, exposing them via Presenter, and rendering them in QML with per-word highlighting based on playback position, along with unit tests and a centisecond parsing fix. Sequence diagram for word-by-word lyric parsing and QML highlightingsequenceDiagram
participant Presenter
participant LyricAnalysis
participant LyricPage
participant LyricRect
Presenter->>LyricAnalysis: setFromFile(lrcPath)
LyricAnalysis->>LyricAnalysis: parseLyric(str)
LyricAnalysis-->>Presenter: allLyrics()
Presenter->>LyricAnalysis: hasWordTiming(i)
Presenter->>LyricAnalysis: getWordTiming(i)
LyricAnalysis-->>Presenter: QVector<LyricWord>
Presenter-->>LyricPage: getLyrics()
LyricPage->>LyricPage: metaChange()
LyricPage->>LyricRect: currentPosition, wordLyricsData
LyricPage->>LyricPage: positionChange(position, length)
LyricPage->>LyricRect: currentPosition
LyricRect->>LyricRect: wordSung = modelData.time <= currentPosition
LyricRect->>LyricRect: per-word highlight via Flow/Repeater
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kt286 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
- Add LyricWord struct for per-word timing data - Parser supports LRC word-by-word format (e.g. [00:27.94]持[00:28.26]有) - Fix centisecond parsing to correctly convert 1/100s to milliseconds - LyricPage/LyricRect add word-by-word rendering with per-word highlight - Presenter passes word timing data to QML layer - Add related unit tests feat: 支持逐字歌词解析与高亮显示 - 新增 LyricWord 结构体,用于存储逐字歌词的时间轴数据 - 解析器支持 LRC 逐字格式(如 [00:27.94]持[00:28.26]有) - 修复厘秒解析,正确将百分之一秒转换为毫秒 - LyricPage/LyricRect 添加逐字歌词渲染逻辑,支持逐字高亮 - Presenter 传递逐字歌词数据到 QML 层 - 添加相关单元测试
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.
feat: 支持逐字歌词解析与高亮显示
Summary by Sourcery
Add support for word-by-word timed lyrics, including parsing, data exposure, and UI highlighting.
New Features:
Bug Fixes:
Enhancements:
Tests: