mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:52:44 +00:00 
			
		
		
		
	 9edaa033e5
			
		
	
	
		9edaa033e5
		
	
	
	
	
		
			
			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.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			846 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			846 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * 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 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);
 | |
| 
 | |
|     RefPtr<Gfx::Bitmap> m_serenity_bg;
 | |
|     RefPtr<Gfx::Bitmap> m_album_cover;
 | |
| };
 |