1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

SoundPlayer: Load cover image from music files

When the visualization is set to "Album Cover", the player will now try
to load the embedded image. On failure, it defaults to a "Cover" image
file in the directory.

In Player::play_file_path, file_name_changed now needs to be executed
after that the loader have been set, to get the correct image.
This commit is contained in:
Lucas CHOLLET 2022-10-04 01:07:18 +02:00 committed by Andrew Kaster
parent 27539440df
commit 7649feb26f
8 changed files with 58 additions and 10 deletions

View file

@ -25,12 +25,12 @@ public:
void set_nonlinear_volume_slider(bool nonlinear);
void set_playlist_visible(bool visible);
template<typename T>
void set_visualization()
template<typename T, typename... Args>
void set_visualization(Args... args)
{
m_visualization->remove_from_parent();
update();
auto new_visualization = T::construct();
auto new_visualization = T::construct(move(args)...);
m_player_view->insert_child_before(new_visualization, *static_cast<Core::Object*>(m_playback_progress_slider.ptr()));
m_visualization = new_visualization;
if (!loaded_filename().is_empty())