-
Notifications
You must be signed in to change notification settings - Fork 8
/
Artwork.h
50 lines (34 loc) · 1.23 KB
/
Artwork.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "Visual.h"
class Artwork : public Visual
{
public:
// 'wndVisual' - Visual container window.
Artwork( WndVisual& wndVisual );
~Artwork() override;
// Returns the required visual height, based on a given width.
int GetHeight( const int width ) override;
// Shows the visual.
void Show() override;
// Hides the visual.
void Hide() override;
// Called when the visual needs repainting.
void OnPaint() override;
// Called when the visual settings have changed.
void OnSettingsChange() override;
// Called when the system colours have changed.
void OnSysColorChange() override;
// Called when the visual should free any resources.
void FreeResources() override;
private:
// Loads the artwork resource from 'mediaInfo', using the 'deviceContext'.
void LoadArtwork( const MediaInfo& mediaInfo, ID2D1DeviceContext* deviceContext );
// Returns the artwork bitmap from 'mediaInfo', or null if a bitmap could not be loaded.
std::unique_ptr<Gdiplus::Bitmap> GetArtworkBitmap( const MediaInfo& mediaInfo );
// Currently displayed bitmap.
Microsoft::WRL::ComPtr<ID2D1Bitmap> m_Bitmap;
// Currently displayed artwork ID.
std::wstring m_ArtworkID;
// The previous drawan size.
D2D1_SIZE_F m_PreviousSize;
};