1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +00:00

SoundPlayer: Auto refresh visualization widgets

Visualization widgets should only have to tell how many samples they
need per frame and have a render method which receives all data relevant
to draw the next frame.
This commit is contained in:
Arne Elster 2022-01-09 22:46:06 +01:00 committed by Andreas Kling
parent 02462b6068
commit 9edaa033e5
7 changed files with 115 additions and 107 deletions

View file

@ -16,10 +16,10 @@ class AlbumCoverVisualizationWidget final : public VisualizationWidget {
public:
~AlbumCoverVisualizationWidget() override = default;
void set_buffer(RefPtr<Audio::Buffer>) override;
void start_new_file(StringView) override;
private:
void render(GUI::PaintEvent&, FixedArray<double> const&) override { }
void paint_event(GUI::PaintEvent&) override;
AlbumCoverVisualizationWidget() = default;
ErrorOr<NonnullRefPtr<Gfx::Bitmap>> get_album_cover(StringView const filename);