diff options
Diffstat (limited to 'Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h')
-rw-r--r-- | Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h b/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h new file mode 100644 index 0000000000..9cc54c5d0b --- /dev/null +++ b/Userland/Applications/SoundPlayer/AlbumCoverVisualizationWidget.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021, Cesar Torres <shortanemoia@protonmail.com> + * Copyright (c) 2022, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include "VisualizationWidget.h" +#include <LibAudio/Buffer.h> +#include <LibGUI/Frame.h> + +class AlbumCoverVisualizationWidget final : public VisualizationWidget { + C_OBJECT(AlbumCoverVisualizationWidget) + +public: + ~AlbumCoverVisualizationWidget() override = default; + void set_buffer(RefPtr<Audio::Buffer>) override; + void start_new_file(StringView) override; + +private: + void paint_event(GUI::PaintEvent&) override; + AlbumCoverVisualizationWidget() = default; + ErrorOr<NonnullRefPtr<Gfx::Bitmap>> get_album_cover(StringView const filename); + + RefPtr<Gfx::Bitmap> m_serenity_bg; + RefPtr<Gfx::Bitmap> m_album_cover; +}; |