Merged
Conversation
This commit introduces several enhancements to the lyrics feature:
1. **Word-by-Word Synchronization:**
- The UI now supports word-by-word lyric highlighting with a smooth animation.
- Data models (`SyncedLine`, `SyncedWord`) have been updated to store word-level timestamps.
2. **Improved LRC Parsing:**
- The parsing logic in `LyricsUtils.kt` has been refactored and is now the centralized parser for all lyric sources.
- It correctly handles LRC timestamps with both 2-digit (centiseconds) and 3-digit (milliseconds) precision, fixing previous synchronization issues.
- It supports an extended LRC format for word-by-word timings.
3. **Lyric File Import:**
- A new option in the "Lyrics not found" dialog allows users to import local lyric files (.lrc, .txt).
- The imported file is parsed, saved to the database, and immediately displayed.
4. **Refactoring:**
- Removed redundant parsing logic from `MusicRepositoryImpl.kt`, which now calls the centralized `LyricsUtils.parseLyrics` function.
- Added `updateLyrics` to the repository layer to facilitate saving imported lyrics.
This commit introduces several enhancements to the lyrics feature:
1. **Word-by-Word Synchronization:**
- The UI now supports word-by-word lyric highlighting with a smooth animation.
- Data models (`SyncedLine`, `SyncedWord`) have been updated to store word-level timestamps.
2. **Improved LRC Parsing:**
- The parsing logic in `LyricsUtils.kt` has been refactored and is now the centralized parser for all lyric sources.
- It correctly handles LRC timestamps with both 2-digit (centiseconds) and 3-digit (milliseconds) precision, fixing previous synchronization issues.
- It supports an extended LRC format for word-by-word timings.
- When synced lyrics are parsed, a plain text version is now automatically generated to ensure UI consistency.
3. **Lyric File Import:**
- A new option in the "Lyrics not found" dialog allows users to import local lyric files (.lrc, .txt).
- The imported file is parsed, saved to the database, and immediately displayed.
4. **Refactoring & Fixes:**
- Removed redundant parsing logic from `MusicRepositoryImpl.kt`, which now calls the centralized `LyricsUtils.parseLyrics` function.
- Added `updateLyrics` to the repository layer to facilitate saving imported lyrics.
- Fixed an issue where the 'Synced/Static' tabs would disappear if only synced lyrics were present.
This commit delivers a significant upgrade to the lyrics feature, addressing user feedback with the following improvements:
1. **High-Precision Timing:**
- The player's progress update loop in `PlayerViewModel` now runs every 40ms (down from 1000ms), enabling millisecond-level accuracy for lyric synchronization.
2. **Bug Fixes:**
- The `lyricsSearchUiState` is now correctly reset to `Idle` on song transitions (`onMediaItemTransition`). This fixes a critical bug where the 'Lyrics not found' dialog would fail to appear for a new song after a previous lyric operation.
3. **Expressive Dialog Redesign:**
- The `FetchLyricsDialog` has been completely redesigned with a custom, expressive Material 3 layout. It now features improved iconography, typography, and button styling for a more modern and intuitive user experience.
4. **Core Lyric Enhancements (from previous commit):**
- Full support for word-by-word synchronized lyrics, from parsing to an animated UI.
- A robust, centralized LRC parser in `LyricsUtils` that handles various timestamp formats and generates plain text fallbacks.
- Functionality for users to import local lyric files directly from the dialog.
This commit updates the icons used in the "Fetch Lyrics" dialog and shortens the "Import file" string to "Import".
- **Icons:**
- Replaced `Icons.Rounded.FileUpload` with `rounded_upload_file_24.xml`.
- Replaced `Icons.Rounded.CloudSearch` with `rounded_manage_search_24.xml`.
- **String:**
- Changed "Import file" to "Import" in `strings.xml`.
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.
No description provided.