[PR #668] Sync lyrics highlighting with playback progress #654

Open
opened 2026-02-28 14:33:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jpochyla/psst/pull/668
Author: @Cleboost
Created: 7/7/2025
Status: 🔄 Open

Base: mainHead: sync-lyric


📝 Commits (4)

  • d3631fa Sync lyrics highlighting with playback progress
  • f3d72de Sync playback state in CommonCtx and update lyrics timing
  • 2512cb5 Refactor progress calculation for lyrics highlighting
  • 8b93b4d Refactor lyrics timing and playback state handling

📊 Changes

3 files changed (+85 additions, -3 deletions)

View changed files

📝 psst-core/src/player/worker.rs (+1 -1)
📝 psst-gui/src/data/mod.rs (+27 -1)
📝 psst-gui/src/ui/lyrics.rs (+57 -1)

📄 Description

This pull request introduces enhancements to playback state management and lyrics synchronization within the psst-gui application. Key changes include the addition of playback state tracking in the CommonCtx, a new LyricsTicker controller for real-time updates, and improvements to the lyrics widget for dynamic synchronization with playback progress.

Playback State Management Enhancements:

  • psst-gui/src/data/mod.rs: Added progress, last_update_ms, and playback_state fields to CommonCtx for tracking playback progress and state. Introduced a helper method set_common_progress to update progress and timestamp consistently. [1] [2] [3]

Lyrics Synchronization Improvements:

  • psst-gui/src/ui/lyrics.rs: Added a LyricsTicker controller for periodic updates to the lyrics widget, ensuring synchronization with playback progress. [1] [2]
  • psst-gui/src/ui/lyrics.rs: Enhanced the lyrics widget to dynamically highlight lyrics based on playback progress, using calculated offsets and playback state. [1] [2]

These changes improve the user experience by providing accurate playback state tracking and seamless lyrics synchronization during music playback.

close https://github.com/jpochyla/psst/issues/658

{64E46E0B-2038-449D-B825-85BA8F226241}


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jpochyla/psst/pull/668 **Author:** [@Cleboost](https://github.com/Cleboost) **Created:** 7/7/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `sync-lyric` --- ### 📝 Commits (4) - [`d3631fa`](https://github.com/jpochyla/psst/commit/d3631fa377cff0bb4a39633f1d6b15e6e0986e2b) Sync lyrics highlighting with playback progress - [`f3d72de`](https://github.com/jpochyla/psst/commit/f3d72deb852637f1cd02a7cce147966f51855b67) Sync playback state in CommonCtx and update lyrics timing - [`2512cb5`](https://github.com/jpochyla/psst/commit/2512cb5219380af4be463fc76b4542d81e604f56) Refactor progress calculation for lyrics highlighting - [`8b93b4d`](https://github.com/jpochyla/psst/commit/8b93b4dc508ead172de990a51a03a4816d1cb2d3) Refactor lyrics timing and playback state handling ### 📊 Changes **3 files changed** (+85 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `psst-core/src/player/worker.rs` (+1 -1) 📝 `psst-gui/src/data/mod.rs` (+27 -1) 📝 `psst-gui/src/ui/lyrics.rs` (+57 -1) </details> ### 📄 Description This pull request introduces enhancements to playback state management and lyrics synchronization within the `psst-gui` application. Key changes include the addition of playback state tracking in the `CommonCtx`, a new `LyricsTicker` controller for real-time updates, and improvements to the lyrics widget for dynamic synchronization with playback progress. ### Playback State Management Enhancements: * [`psst-gui/src/data/mod.rs`](diffhunk://#diff-61cf8f924bec65363cf27da5e3bafd32df5d9af631d9dbdaf26c6e9c5e7d1997R107-R109): Added `progress`, `last_update_ms`, and `playback_state` fields to `CommonCtx` for tracking playback progress and state. Introduced a helper method `set_common_progress` to update progress and timestamp consistently. [[1]](diffhunk://#diff-61cf8f924bec65363cf27da5e3bafd32df5d9af631d9dbdaf26c6e9c5e7d1997R107-R109) [[2]](diffhunk://#diff-61cf8f924bec65363cf27da5e3bafd32df5d9af631d9dbdaf26c6e9c5e7d1997R572-R574) [[3]](diffhunk://#diff-61cf8f924bec65363cf27da5e3bafd32df5d9af631d9dbdaf26c6e9c5e7d1997R352-R365) ### Lyrics Synchronization Improvements: * [`psst-gui/src/ui/lyrics.rs`](diffhunk://#diff-889e3341f228e173411414724faaf99c1de5e9fadaa5512a631efa3657a7506dL5-R70): Added a `LyricsTicker` controller for periodic updates to the lyrics widget, ensuring synchronization with playback progress. [[1]](diffhunk://#diff-889e3341f228e173411414724faaf99c1de5e9fadaa5512a631efa3657a7506dL5-R70) [[2]](diffhunk://#diff-889e3341f228e173411414724faaf99c1de5e9fadaa5512a631efa3657a7506dR85) * [`psst-gui/src/ui/lyrics.rs`](diffhunk://#diff-889e3341f228e173411414724faaf99c1de5e9fadaa5512a631efa3657a7506dR134-R185): Enhanced the lyrics widget to dynamically highlight lyrics based on playback progress, using calculated offsets and playback state. [[1]](diffhunk://#diff-889e3341f228e173411414724faaf99c1de5e9fadaa5512a631efa3657a7506dR134-R185) [[2]](diffhunk://#diff-889e3341f228e173411414724faaf99c1de5e9fadaa5512a631efa3657a7506dL94-R228) These changes improve the user experience by providing accurate playback state tracking and seamless lyrics synchronization during music playback. close https://github.com/jpochyla/psst/issues/658 ![{64E46E0B-2038-449D-B825-85BA8F226241}](https://github.com/user-attachments/assets/922d5ea6-5974-4189-a205-23a982ae8a59) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#654
No description provided.