Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement lyrics #4107

Merged
merged 1 commit into from
Oct 26, 2024
Merged

Implement lyrics #4107

merged 1 commit into from
Oct 26, 2024

Conversation

nielsvanvelzen
Copy link
Member

@nielsvanvelzen nielsvanvelzen commented Oct 26, 2024

After months of procrastinatingwork, we now have 🎤 Lyrics in the app!

Supports both synced (highlight current line) and unsynced (continuous scroll) lyrics. It does introduce a tiny display bug with the seekbar in the screensaver, I'll fix that later.

Changes

  • Load lyrics for queue items and add them to the new lyrics element
  • Add lyric display in screensaver
  • Add (small) lyric display in now playing view (on top of album art)
  • Move overscan modifier to a new "modifier" subpackage
  • Add new "fadingEdges" modifier that adds a fade-out edge

Screenshots

No screenshots for now because we don't have lyrics on the demo server :(

Issues

Part of #1057
Closes #3742
Closes #2988

@nielsvanvelzen nielsvanvelzen added enhancement New feature or request release-highlight Pull request might be suitable for mentioning in the release blog post labels Oct 26, 2024
@nielsvanvelzen nielsvanvelzen added this to the v0.18.0 milestone Oct 26, 2024
@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review October 26, 2024 14:28
drawRect(Color.White, size = size.copy(width = size.width * progress))
drawRect(
Color.White,
size = size.copy(width = size.width * (playbackPosition.inWholeMilliseconds.toFloat() / playbackDuration.inWholeMilliseconds.toFloat()))

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning

Line detected, which is longer than the defined maximum line length in the code style.
import org.jellyfin.sdk.model.extensions.ticks
import kotlin.time.Duration

data class TimedLine(

Check warning

Code scanning / detekt

If a source file contains only a single non-private top-level class or object, the file name should reflect the case-sensitive name plus the .kt extension. Warning

The file name 'LyricsBox' does not match the name of the single top-level declaration 'TimedLine'.
Comment on lines +157 to +165
fun LyricsBox(
lines: List<String>,
modifier: Modifier = Modifier,
currentTimestamp: Duration = Duration.ZERO,
duration: Duration = Duration.ZERO,
paused: Boolean = false,
fontSize: TextUnit = LocalTextStyle.current.fontSize,
color: Color = LocalTextStyle.current.color,
) = Box(modifier) {

Check warning

Code scanning / detekt

The more parameters a function has the more complex it is. Long parameter lists are often used to control complex algorithms and violate the Single Responsibility Principle. Prefer functions with short parameter lists. Warning

The function LyricsBox(lines: List, modifier: Modifier, currentTimestamp: Duration, duration: Duration, paused: Boolean, fontSize: TextUnit, color: Color) has too many parameters. The current threshold is set to 6.
Comment on lines +205 to +213
fun LyricsDtoBox(
lyricDto: LyricDto,
modifier: Modifier = Modifier,
currentTimestamp: Duration = Duration.ZERO,
duration: Duration = Duration.ZERO,
paused: Boolean = false,
fontSize: TextUnit = LocalTextStyle.current.fontSize,
color: Color = LocalTextStyle.current.color,
) = Box(modifier) {

Check warning

Code scanning / detekt

The more parameters a function has the more complex it is. Long parameter lists are often used to control complex algorithms and violate the Single Responsibility Principle. Prefer functions with short parameter lists. Warning

The function LyricsDtoBox(lyricDto: LyricDto, modifier: Modifier, currentTimestamp: Duration, duration: Duration, paused: Boolean, fontSize: TextUnit, color: Color) has too many parameters. The current threshold is set to 6.

@Preview
@Composable
private fun FadingEdgePreview() {

Check warning

Code scanning / detekt

Private function is unused and should be removed. Warning

Private function FadingEdgePreview is unused.
@nielsvanvelzen nielsvanvelzen merged commit 786110b into jellyfin:master Oct 26, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the lyrics branch October 26, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release-highlight Pull request might be suitable for mentioning in the release blog post
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to add lyrics display on the TV side music lyrics
2 participants