SoundPlayer: Show album cover in the Album Cover visualization#12841
Merged
bgianfo merged 5 commits intoSerenityOS:masterfrom Mar 3, 2022
Merged
SoundPlayer: Show album cover in the Album Cover visualization#12841bgianfo merged 5 commits intoSerenityOS:masterfrom
bgianfo merged 5 commits intoSerenityOS:masterfrom
Conversation
This adds a new start_new_file() function to VisualizationWidget which is called when the player starts a new file, passing the filename of the file. This allows VisualizationWidget subclasses to do any setup needed when a new file is started.
bgianfo
reviewed
Mar 2, 2022
bgianfo
reviewed
Mar 2, 2022
bgianfo
reviewed
Mar 2, 2022
bgianfo
suggested changes
Mar 2, 2022
Member
bgianfo
left a comment
There was a problem hiding this comment.
Looks good, just a few minor nit picks.
Display the album cover for the current playing song in the visualization area for the "None" Visualization. For now only "cover.png" and "cover.jpg" are looked for in the same directory for the album cover image. When no cover image is found the serenity background is shown instead as a fallback.
Since the NoVisualization widget now shows the album cover, it should be called AlbumCoverVisualization instead.
Instead of drawing the album cover scaled to cover the whole visualization area, draw it resized to fit the area without altering the aspect ratio.
b2b6238 to
4fc9fc4
Compare
Contributor
Author
|
@bgianfo All feedback addressed, thanks for the review! |
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.
This PR renames the "None" visualization to "Album Cover" and shows the album cover for the current loaded sound file there.
This is just the first small step, and simply looks for a file named "cover.png" or "cover.jpg" in the same directory as the sound file, since this is common practice. In the future we'd want to also try loading the image embedded in the sound file and only use the "cover.png" file as a fallback.